safe-tensor-0.2.1.0: Dependently typed tensor algebra
Copyright(c) Nils Alex 2020
LicenseMIT
Maintainernils.alex@fau.de
Safe HaskellNone
LanguageHaskell2010

Math.Tensor.LinearAlgebra.Matrix

Description

Gaussian elimination subroutines.

Synopsis

Documentation

gaussianST :: Int -> Int -> STMatrix s Double -> ST s () Source #

Gaussian elimination perfomed in-place in the ST monad.

gaussianFFST :: Int -> Int -> STMatrix s Z -> ST s () Source #

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 ]

rrefST :: Int -> Int -> STMatrix s Z -> ST s () Source #

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]

findPivotMax :: Int -> Int -> Int -> Int -> STMatrix s Double -> ST s (Maybe (Int, Int)) Source #

findPivotMaxFF :: Int -> Int -> Int -> Int -> STMatrix s Z -> ST s (Maybe (Int, Int)) Source #

Find pivot element below position (i, j) with greatest absolute value in the ST monad.

findRowPivot :: Int -> Int -> Int -> Int -> STMatrix s Z -> ST s (Maybe Int) Source #

isref :: (Num a, Ord a, Container Vector a) => Matrix a -> Bool Source #

isrref' :: (Num a, Ord a, Container Vector a) => Int -> Matrix a -> Bool Source #