statistics-0.13.2.3: A library of statistical types, data, and functions

Copyright | 2014 Bryan O'Sullivan
License | BSD3
Safe Haskell | None
Language | Haskell98

Statistics.Matrix.Types

Description

Basic matrix operations.

There isn't a widely used matrix package for Haskell yet, so we implement the necessary minimum here.

Synopsis

- type Vector = Vector Double
- type MVector s = MVector s Double
- data Matrix = Matrix {
  - rows :: !Int
  - cols :: !Int
  - exponent :: !Int
  - _vector :: !Vector
  }
- data MMatrix s = MMatrix !Int !Int !Int !(MVector s)
- debug :: Matrix -> String

# Documentation

type Vector = Vector Double Source

type MVector s = MVector s Double Source

data Matrix Source

Two-dimensional matrix, stored in row-major order.

Constructors

Matrix |

Fields

rows :: !Int

  Rows of matrix.

cols :: !Int

  Columns of matrix.

exponent :: !Int

  In order to avoid overflows during matrix multiplication, a large exponent is stored separately.

_vector :: !Vector

  Matrix data.

Instances

Eq Matrix Source |
Show Matrix Source |

data MMatrix s Source

Two-dimensional mutable matrix, stored in row-major order.

Constructors

MMatrix !Int !Int !Int !(MVector s) |

debug :: Matrix -> String Source