This module includes a few (standard) functions to work with matrixes.
- data Matrix t
- type RawMatrix a = [[a]]
- class Storable a => Element a
- flatten :: Element t => Matrix t -> Vector t
- toColumns :: Element t => Matrix t -> [Vector t]
- toLists :: Element t => Matrix t -> [[t]]
- toRows :: Element t => Matrix t -> [Vector t]
- asRow :: Storable a => Vector a -> Matrix a
- fromLists :: Element t => [[t]] -> Matrix t
- fromListToQuadraticMatrix :: [Double] -> Matrix Double
- (@@>) :: Storable t => Matrix t -> (Int, Int) -> t
- eigenvalue :: Matrix Double -> Double
- eigenvector :: Matrix Double -> Vector Double
- inv :: Field t => Matrix t -> Matrix t
- identityMatrix :: Int -> Matrix Double
- mapMatrix :: (Double -> Double) -> Matrix Double -> Matrix Double
- reduceMatrix :: Matrix Double -> Matrix Double
- scalarMultiplication :: Double -> Matrix Double -> Matrix Double
- subtractMatrix :: Matrix Double -> Matrix Double -> Matrix Double
- trans :: Matrix t -> Matrix t
- zipAllWith :: (RawVector a -> b) -> RawMatrix a -> RawVector b
data Matrix t
Matrix representation suitable for GSL and LAPACK computations.
The elements are stored in a continuous memory array.
|Joinable Matrix Matrix|
|Joinable Matrix Vector|
|Joinable Vector Matrix|
|Normed Matrix Double|
|Normed Matrix Float|
|Container Vector a => Container Matrix a|
|Normed Matrix (Complex Double)|
|Normed Matrix (Complex Float)|
|(Element a, Read a) => Read (Matrix a)|
|(Show a, Element a) => Show (Matrix a)|
|(Binary a, Element a, Storable a) => Binary (Matrix a)|
Represents a matrix
Supported matrix elements.
This class provides optimized internal
operations for selected element types.
It provides unoptimised defaults for any
so you can create instances simply as:
instance Element Foo.
The elements of a matrix
Convert a Matrix into another Type
Creates a vector by concatenation of rows
> flatten (
ident3) 9 |> [1.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0]
Flattens a matrix to a vector
Creates a list of vectors from the columns of a matrix
Converts the representation of a matrix to a list of vectors by its columns.
Converts the representation of a matrix to a list of lists. (NOT equivalent with toRows!!!)
Converts the representation of a matrix to a list of vectors by its rows.
Convert some Data into Matrix-Type
Converts the representation of a matrix from a list of vectors to a matrix (by rows)
Matrix from a list of lists (considered as rows).
> fromLists [[1,2],[3,4],[5,6]] (3><2) [ 1.0, 2.0 , 3.0, 4.0 , 5.0, 6.0 ]
Converts the representation of a matrix from a list of lists to a matrix (NOT equivalent with asRows!!!)
Get the matrix-element in row x and col y (like (!!) for lists)
Calculates the eigenvalue of a matrix, e.g.
eigenvalue (fromLists [[0.77143,-0.25714],[-0.42245,0.14082]])
Calculates one eigenvector of a given matrix, e.g.
eigenvector (fromLists [[-0.14081563757848092,-0.25714],[-0.42245,-0.7714256375784809]])
Calculates the invariant matrix of the input matrix
Calculates the identity matrix (n x n) by given scale (n)
A simple map-Function which maps a given function on every element of the given matrix
Calculates the reduced matrix of a given matrix (by reducing the given matrix), e.g.
reduceMatrix (fromLists [[0.77143,-0.25714],[-0.42245,0.14082]])
Calculates the scalarproduct (with a scalar and matrix)
Calculates the difference (matrix) between two matrixes
Transposes a matrix