HaskellForMaths-0.4.5: Combinatorics, group theory, commutative algebra, non-commutative algebra

Safe HaskellSafe-Infered

Math.Algebra.LinearAlgebra

Description

A module providing elementary operations involving scalars, vectors, and matrices over a ring or field. Vectors are represented as [a], matrices as [[a]]. (No distinction is made between row and column vectors.) It is the caller's responsibility to ensure that the lists have the correct number of elements.

The mnemonic for many of the arithmetic operations is that the number of angle brackets on each side indicates the dimension of the argument on that side. For example, v <*>> m is multiplication of a vector on the left by a matrix on the right.

Synopsis

Documentation

(<+>) :: Num a => [a] -> [a] -> [a]Source

u <+> v returns the sum u+v of vectors

(<->) :: Num a => [a] -> [a] -> [a]Source

u <-> v returns the difference u-v of vectors

(*>) :: Num a => a -> [a] -> [a]Source

k *> v returns the product k*v of the scalar k and the vector v

(<.>) :: Num a => [a] -> [a] -> aSource

u <.> v returns the dot product of vectors (also called inner or scalar product)

(<*>) :: Num a => [a] -> [a] -> [[a]]Source

u <*> v returns the tensor product of vectors (also called outer or matrix product)

(<<+>>) :: Num a => [[a]] -> [[a]] -> [[a]]Source

a <<+>> b returns the sum a+b of matrices

(<<->>) :: Num a => [[a]] -> [[a]] -> [[a]]Source

a <<->> b returns the difference a-b of matrices

(<<*>>) :: Num a => [[a]] -> [[a]] -> [[a]]Source

a <<*>> b returns the product a*b of matrices

(*>>) :: Num a => a -> [[a]] -> [[a]]Source

k *>> m returns the product k*m of the scalar k and the matrix m

(<<*>) :: Num a => [[a]] -> [a] -> [a]Source

m <<*> v is multiplication of a vector by a matrix on the left

(<*>>) :: Num a => [a] -> [[a]] -> [a]Source

v <*>> m is multiplication of a vector by a matrix on the right

fMatrix :: (Enum t1, Num t1) => t1 -> (t1 -> t1 -> t) -> [[t]]Source

fMatrix' :: (Enum t1, Num t1) => t1 -> (t1 -> t1 -> t) -> [[t]]Source

idMx :: Num a => Int -> [[a]]Source

iMx :: Num t => Int -> [[t]]Source

iMx n is the n*n identity matrix

jMx :: Num t => Int -> [[t]]Source

jMx n is the n*n matrix of all 1s

zMx :: Num t => Int -> [[t]]Source

zMx n is the n*n matrix of all 0s

inverse :: (Eq a, Fractional a) => [[a]] -> Maybe [[a]]Source

The inverse of a matrix (over a field), if it exists

inverse1 :: (Eq a, Fractional a) => [[a]] -> [[a]]Source

inverse2 :: (Eq t, Num t) => [[t]] -> [[t]]Source

(!) :: [a] -> Int -> aSource

rowEchelonForm :: (Eq a, Fractional a) => [[a]] -> [[a]]Source

reducedRowEchelonForm :: (Eq a, Fractional a) => [[a]] -> [[a]]Source

solveLinearSystem :: (Eq a, Fractional a) => [[a]] -> [a] -> Maybe [a]Source

isZero :: (Eq a, Num a) => [a] -> BoolSource

inSpanRE :: (Eq a, Num a) => [[a]] -> [a] -> BoolSource

rank :: (Eq a, Fractional a) => [[a]] -> IntSource

kernel :: (Fractional a, Ord a) => [[a]] -> [[a]]Source

kernelRRE :: (Num a, Ord a) => [[a]] -> [[a]]Source

det :: (Eq a, Fractional a) => [[a]] -> aSource

The determinant of a matrix (over a field)