Copyright | Peter Robinson 2014 |
---|---|
License | LGPL |
Maintainer | Peter Robinson <peter.robinson@monoid.at> |
Stability | experimental |
Portability | portable |
Safe Haskell | Trustworthy |
Language | Haskell2010 |
Linear algebra computations in a finite prime field.
- newtype FField = FField {}
- prime :: Int
- type FMatrix = Matrix FField
- dotProduct :: Num a => Vector a -> Vector a -> a
- forwardSub :: Fractional a => Matrix a -> Vector a -> Vector a
- backwardSub :: Fractional a => Matrix a -> Vector a -> Vector a
- inverse :: (Ord a, Fractional a) => Matrix a -> Matrix a
- vandermonde :: Int -> [FField] -> FMatrix
- vmatrix :: Int -> Int -> FMatrix
Documentation
Our finite prime field. All computations are performed in this field.
dotProduct :: Num a => Vector a -> Vector a -> a Source
forwardSub :: Fractional a => Matrix a -> Vector a -> Vector a Source
Solves a linear equality system A x = b
given by a lower triangular matrix via
forward substitution.
backwardSub :: Fractional a => Matrix a -> Vector a -> Vector a Source
Solves a linear equality system A x = b
given by an upper triangular matrix via
backward substitution.
inverse :: (Ord a, Fractional a) => Matrix a -> Matrix a Source
Compute the inverse of matrix. Throws AssertionFailed
if the matrix is
not invertible.
vandermonde :: Int -> [FField] -> FMatrix Source
Construct a Vandermonde matrix. The i-th list element is the i-th seed of the geometric progression of the i-th row.