Copyright | (c) 2019 Tobias Reinhart and Nils Alex |
---|---|
License | MIT |
Maintainer | tobi.reinhart@fau.de, nils.alex@fau.de |
Safe Haskell | None |
Language | Haskell2010 |
Gaussian elimination algorithm based on hmatrix.
Synopsis
- gaussianST :: Int -> Int -> STMatrix s Double -> ST s ()
- gaussian :: Matrix Double -> Matrix Double
- independentColumns :: Matrix Double -> [Int]
- independentColumnsMat :: Matrix Double -> Matrix Double
- pivotsU :: Matrix Double -> [Int]
- findPivotMax :: Int -> Int -> Int -> Int -> STMatrix s Double -> ST s (Maybe (Int, Int))
Gaussian Elimination
gaussianST :: Int -> Int -> STMatrix s Double -> ST s () Source #
Gaussian elimination perfomed in-place in the
monad.ST
gaussian :: Matrix Double -> Matrix Double Source #
Gaussian elimination as pure function. Involves a copy of the input matrix.
λ let mat = (3 >< 4) [1, 1, -2, 0, 0, 2, -6, -4, 3, 0, 3, 1] λ mat (3><4) [ 1.0, 1.0, -2.0, 0.0 , 0.0, 2.0, -6.0, -4.0 , 3.0, 0.0, 3.0, 1.0 ] λ gaussian mat (3><4) [ 3.0, 0.0, 3.0, 1.0 , 0.0, 2.0, -6.0, -4.0 , 0.0, 0.0, 0.0, 1.6666666666666667 ]
Linearly Independent Columns
independentColumns :: Matrix Double -> [Int] Source #
Returns the indices of a maximal linearly independent subset of the columns in the matrix.
λ let mat = (3 >< 4) [1, 1, -2, 0, 0, 2, -6, -4, 3, 0, 3, 1] λ mat (3><4) [ 1.0, 1.0, -2.0, 0.0 , 0.0, 2.0, -6.0, -4.0 , 3.0, 0.0, 3.0, 1.0 ] λ independentColumns mat [0,1,3]
independentColumnsMat :: Matrix Double -> Matrix Double Source #
Returns a sub matrix containing a maximal linearly independent subset of the columns in the matrix.
λ let mat = (3 >< 4) [1, 1, -2, 0, 0, 2, -6, -4, 3, 0, 3, 1] λ mat (3><4) [ 1.0, 1.0, -2.0, 0.0 , 0.0, 2.0, -6.0, -4.0 , 3.0, 0.0, 3.0, 1.0 ] λ independentColumnsMat mat (3><3) [ 1.0, 1.0, 0.0 , 0.0, 2.0, -4.0 , 3.0, 0.0, 1.0 ]