Copyright | (c) Nils Alex 2020 |
---|---|
License | MIT |
Maintainer | nils.alex@fau.de |
Safe Haskell | None |
Language | Haskell2010 |
Gaussian elimination subroutines.
Synopsis
- gaussianST :: Int -> Int -> STMatrix s Double -> ST s ()
- gaussianFFST :: Int -> Int -> STMatrix s Z -> ST s ()
- gaussian :: Matrix Double -> Matrix Double
- gaussianFF :: Matrix Z -> Matrix Z
- rrefST :: Int -> Int -> STMatrix s Z -> ST s ()
- rref :: Matrix Z -> Matrix Z
- independentColumns :: Matrix Double -> [Int]
- independentColumnsFF :: Matrix Z -> [Int]
- independentColumnsRREF :: Matrix Z -> [Int]
- independentColumnsVerifiedFF :: Matrix Z -> [Int]
- independentColumnsMat :: Matrix Double -> Matrix Double
- independentColumnsMatFF :: Matrix Z -> Matrix Z
- independentColumnsMatRREF :: Matrix Z -> Matrix Z
- pivotsU :: Matrix Double -> [Int]
- pivotsUFF :: Matrix Z -> [Int]
- findPivotMax :: Int -> Int -> Int -> Int -> STMatrix s Double -> ST s (Maybe (Int, Int))
- findPivotMaxFF :: Int -> Int -> Int -> Int -> STMatrix s Z -> ST s (Maybe (Int, Int))
- findRowPivot :: Int -> Int -> Int -> Int -> STMatrix s Z -> ST s (Maybe Int)
- isref :: (Num a, Ord a, Container Vector a) => Matrix a -> Bool
- isrref :: (Num a, Ord a, Container Vector a) => Matrix a -> Bool
- isrref' :: (Num a, Ord a, Container Vector a) => Int -> Matrix a -> Bool
- verify :: Matrix Z -> Matrix Z -> Bool
Documentation
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 ]
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 ]
pivotsU :: Matrix Double -> [Int] Source #
Returns the pivot columns of an upper triangular matrix.
λ let mat = (3 >< 4) [1, 0, 2, -3, 0, 0, 1, 0, 0, 0, 0, 0] λ mat (3><4) [ 1.0, 0.0, 2.0, -3.0 , 0.0, 0.0, 1.0, 0.0 , 0.0, 0.0, 0.0, 0.0 ] λ pivotsU mat [0,2]