Two-dimensional matrix, stored in row-major order.
Moduledense-linear-algebra-0.1.0.0Haskell2010
Statistics.Matrix
Basic matrix operations.
There isn't a widely used matrix package for Haskell yet, so we implement the necessary minimum here.
- 2 types
- 29 values
- Packagedense-linear-algebra-0.1.0.0
- Exports31
- LanguageHaskell2010
- LicenceBSD-2-Clause
- SourceMatrix.hs
Data types
2 declarationsConversion fromto listsvectors
10 declarationsfromVector Convert from a row-major vector.
fromList Convert from a row-major list.
create a matrix from a list of lists, as rows
create a matrix from a list of vectors, as rows
create a matrix from a list of vectors, as columns
Convert to a row-major flat vector.
Convert to a row-major flat list.
Convert to a list of vectors, as rows
Convert to a list of vectors, as columns
Convert to a list of lists, as rows
Other
19 declarationsgenerate Generate matrix using function
generateSym Generate symmetric square matrix using function
Create the square identity matrix with given dimensions.
Create a square matrix with given diagonal, other entries default to 0
Return the dimensions of this matrix, as a (row,column) pair.
Element in the center of matrix (not corrected for exponent).
Matrix-matrix multiplication. Matrices must be of compatible sizes (note: not checked).
Matrix-vector multiplication.
Raise matrix to nth power. Power must be positive (/note: not checked).
Calculate the Euclidean norm of a vector.
Return the given column.
Return the given row.
Apply function to every element of matrix
Simple for loop. Counts from start to end-1.
Indicate whether any element of the matrix is NaN.
Given row and column numbers, calculate the offset into the flat row-major vector.
Given row and column numbers, calculate the offset into the flat row-major vector, without checking.