jonathanfishbein1/linear-algebra/6.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

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

Type to represent result of Gauss-Jordan reduction

= VectorSpace Int

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

addRealMatrices : Matrix number -> Matrix number -> Matrix number

Add two Real Matrices together

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

Add two Complex Matrices together

sumRealMatrices : Matrix number -> Monoid (Matrix number)

Monoidally add two Real numbered Matrices together

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

Monoidally add two Complex numbered 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

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

Matrix Matrix multiplication for a Complex Numbered Matrix

multiplyRealMatrices : Matrix number -> Matrix number -> Result String (Matrix number)

Matrix Matrix multiplication for a Real Numbered Matrix

identityMatrix : Int -> Matrix Int

Create Identity Matrix with n dimension

gaussJordan : Matrix Float -> Matrix Float

Function composition of Gaussian Elimination and Jordan Elimination

gaussianReduce : Matrix Float -> Matrix Float

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 : Matrix Float -> Matrix Float

Internal function for Jordan Elimination

areLinearlyIndependent : List (Vector Float) -> Bool

Predicate to determine if a list of Vectors are linearly independent

multiplyRealVectorRealMatrix : Matrix number -> Vector number -> Vector number

Multiply a real Vector by a real Matrix

Calculate the null space of a matrix

solve : Matrix Float -> ColumnVector Float -> Solution

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

areBasis : VectorSpace -> List (Vector Float) -> Bool

Determine whether list of vectors are a basis for a space

basisOfVectorSpace : VectorSpace -> List (Vector Float) -> List (Vector Float)

Determine the basis vectors of a vector space

doesSetSpanSpace : VectorSpace -> List (Vector Float) -> 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

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 : Matrix Float -> Result String Float

Try to calculate the determinant

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

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

print : Matrix Float -> String

Print a matrix to a string

read : String -> Result (List DeadEnd) (Matrix 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 : Matrix Float -> Result String (Matrix Float)

Put a matrix into Upper Triangular Form

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

Try to calculate the determinant

Matrix (ComplexNumberCartesian Float)
-> Matrix (ComplexNumberCartesian Float)

Gaussian Elimination

invert : Matrix Float -> Result String (Matrix Float)

Try to calculate the inverse of a real numbered matrix

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

Try to calculate the inverse of a complex numbered matrix

isUnitary : Matrix (ComplexNumberCartesian Float) -> Bool

Determine whether a matirx is unitary

Matrix (ComplexNumberCartesian Float)
-> Matrix (ComplexNumberCartesian Float)

Internal function for Jordan Elimination

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

Put a matrix into Upper Triangular Form

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

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