Safe Haskell | None |
---|
- data Matrix = Matrix {}
- fromList :: [[Double]] -> Matrix
- toList :: Matrix -> [[Double]]
- empty :: Matrix
- zero :: Int -> Int -> Matrix
- ones :: Int -> Int -> Matrix
- identity :: Int -> Matrix
- constant :: Int -> Int -> Double -> Matrix
- cols :: Matrix -> Int
- rows :: Matrix -> Int
- coeff :: Int -> Int -> Matrix -> Double
- minCoeff :: Matrix -> Double
- maxCoeff :: Matrix -> Double
- col :: Int -> Matrix -> [Double]
- row :: Int -> Matrix -> [Double]
- block :: Int -> Int -> Int -> Int -> Matrix -> Matrix
- topRows :: Int -> Matrix -> Matrix
- bottomRows :: Int -> Matrix -> Matrix
- leftCols :: Int -> Matrix -> Matrix
- rightCols :: Int -> Matrix -> Matrix
- norm :: Matrix -> Double
- squaredNorm :: Matrix -> Double
- determinant :: Matrix -> Double
- inverse :: Matrix -> Matrix
- adjoint :: Matrix -> Matrix
- transpose :: Matrix -> Matrix
- normalize :: Matrix -> Matrix
- freeze :: MMatrix -> IO Matrix
- thaw :: Matrix -> IO MMatrix
- modify :: (MMatrix -> IO ()) -> Matrix -> Matrix
- with :: Matrix -> (Ptr C_MatrixXd -> IO a) -> IO a
Matrix type
constant Matrix class to be used in pure computations, uses the same column major memory layout as Eigen MatrixXd
Matrix conversions
fromList :: [[Double]] -> MatrixSource
construct matrix from a list of rows, column count is detected as maximum row length
Standard matrices and special cases
Accessing matrix data
block :: Int -> Int -> Int -> Int -> Matrix -> MatrixSource
extract rectangular block from matrix defined by startRow startCol blockRows blockCols
bottomRows :: Int -> Matrix -> MatrixSource
bottom n rows of matrix
Matrix properties
norm :: Matrix -> DoubleSource
for vectors, the l2 norm, and for matrices the Frobenius norm. In both cases, it consists in the square root of the sum of the square of all the matrix entries. For vectors, this is also equals to the square root of the dot product of this with itself.
squaredNorm :: Matrix -> DoubleSource
for vectors, the squared l2 norm, and for matrices the Frobenius norm. In both cases, it consists in the sum of the square of all the matrix entries. For vectors, this is also equals to the dot product of this with itself.
determinant :: Matrix -> DoubleSource
the determinant of the matrix
Matrix transformations
inverse :: Matrix -> MatrixSource
inverse of the matrix
For small fixed sizes up to 4x4, this method uses cofactors. In the general case, this method uses class PartialPivLU