jonathanfishbein1/linear-algebra/7.0.0

NOTE: the latest version is 30.0.0

Matrix

A module for Matrix

Types

type Matrix a
= Matrix (List (RowVector a))

Matrix type

type RowVector a
= RowVector (Vector a)

Row Vector

= ColumnVector (Vector a)

Column Vector

type Solution a
= UniqueSolution (ColumnVector a)
| InfiniteSolutions
{ nullity : Int
, rank : Int
}
| NoUniqueSolution String

Type to represent result of Gauss-Jordan reduction

= VectorDimension Int

Type to represent vector space such as R, R2, R3

addMatrices : Field a -> Matrix a -> Matrix a -> Matrix a

Add two Matrices together

sumMatrices : AbelianGroup a -> Matrix a -> Monoid (Matrix a)

Monoidally add two Matrices together

map : (a -> b) -> Matrix a -> Matrix b

Map over a Matrix

equal : (a -> a -> Bool) -> Matrix a -> Matrix a -> Bool

Compare two matricies using comparator

Transpose a Matrix

Matrix (ComplexNumberCartesian number)
-> Matrix (ComplexNumberCartesian number)

Take the complex conjugate of a Complex Numbered Matrix

Matrix (ComplexNumberCartesian number)
-> Matrix (ComplexNumberCartesian number)

Perform the adjoint operation on a Complex Numbered Matrix

apply : Matrix (a -> b) -> Matrix a -> Matrix b

Apply for Matrix

liftA2 : (a -> b -> c) -> Matrix a -> Matrix b -> Matrix c

Lift a function to work on Matrix

InnerProductSpace a
-> Matrix a
-> Matrix a
-> Result String (Matrix a)

Matrix Matrix multiplication

identityMatrix : Field a -> Int -> Matrix a

Create Identity Matrix with n dimension

gaussJordan : VectorSpace a -> Matrix a -> Matrix a

Function composition of Gaussian Elimination and Jordan Elimination

gaussianReduce : VectorSpace a -> Matrix a -> Matrix a

Gaussian Elimination

isHermitian : Matrix (ComplexNumberCartesian number) -> Bool

Predicate to determine if Matrix is Hermitian

isSymmetric : Matrix a -> Bool

Predicate to determine if Matrix is symmetric

jordanReduce : VectorSpace a -> Matrix a -> Matrix a

Internal function for Jordan Elimination

areLinearlyIndependent : VectorSpace a -> List (Vector a) -> Bool

Predicate to determine if a list of Vectors are linearly independent

multiplyVectorMatrix : InnerProductSpace a -> Matrix a -> Vector a -> Vector a

Multiply a Vector by a Matrix

nullSpace : VectorSpace a -> Matrix a -> Solution a

Calculate the null space of a matrix

solve : VectorSpace a -> Matrix a -> ColumnVector a -> Solution a

Solve a system of linear equations using Gauss-Jordan elimination with explict augmented side column vector

areBasis : VectorSpace a -> VectorDimension -> List (Vector a) -> Bool

Determine whether list of vectors are a basis for a space

VectorSpace a
-> List (Vector a)
-> List (Vector a)

Determine the basis vectors of a vector space

VectorSpace a
-> List (Vector a)
-> Result String Bool

Determine whether list of vectors spans a space

mDimension : Matrix a -> Int

Number of rows in Matrix

nDimension : Matrix a -> Int

Number of columns in Matrix

solveMatrix : VectorSpace a -> Matrix a -> Solution a

Solve a system of linear equations using Gauss-Jordan elimination

foldl : (a -> b -> b) -> b -> Matrix a -> b

Left fold over a Matrix

Monoidally append Matricies together horizontally

Monoidally append Matricies together vertically

Monoid empty for Vector

pure : a -> Matrix a

Applicative pure for Matrix

bind : Matrix a -> (a -> Matrix b) -> Matrix b

Monad bind for Matrix

determinant : VectorSpace a -> Matrix a -> Result String a

Try to calculate the determinant

getAt : ( Int, Int ) -> Matrix a -> Maybe a

Get the value in a matrix at the specified row and column

printRealMatrix : Matrix Float -> String

Print a Real matrix to a string

printComplexMatrix : Matrix (ComplexNumberCartesian Float) -> String

Print a Complex matrix to a string

readRealMatrix : String -> Result (List DeadEnd) (Matrix Float)

Try to read a string into a Matrix

String
-> Result (List DeadEnd) (Matrix (ComplexNumberCartesian Float))

Try to read a string into a Matrix

setAt : ( Int, Int ) -> a -> Matrix a -> Matrix a

Set the value in a Matrix at the specified row and column

upperTriangle : VectorSpace a -> Matrix a -> Result String (Matrix a)

Put a matrix into Upper Triangular Form

invert : VectorSpace a -> Matrix a -> Result String (Matrix a)

Try to calculate the inverse of a matrix

isUnitary : Matrix (ComplexNumberCartesian Float) -> Bool

Determine whether a matirx is unitary

subMatrix : Int -> Int -> Int -> Int -> Matrix a -> Matrix a

Calculate the submatrix given a starting and ending row and column index

matrixTensorProduct : Field a -> Matrix a -> Matrix a -> Matrix a

Calculate the tensor product of two Matricies

Determine whether a matirx is square

isInvertable : VectorSpace a -> Matrix a -> Result String (Matrix a)

Determine whether a matirx is invertable