jonathanfishbein1/linear-algebra/20.0.0

NOTE: the latest version is 30.0.0

SquareMatrix

A module for Square Matrix

Types

= SquareMatrix (Matrix a)

Square Matrix type

type alias InnerProductSpace a =
{ matrixSpace : MatrixSpace a
, innerProduct : SquareMatrix a -> SquareMatrix a -> Result String a
, norm : SquareMatrix a -> Result String Float
, distance : SquareMatrix a -> SquareMatrix a -> Result String Float
}

Type to represent an Inner Product Space

Values

zeroSquareMatrix : Field a -> Int -> SquareMatrix a

Create square Matrix with n dimension filled with zeros

realMatrixInnerProductSpace : InnerProductSpace Float

Real Numbered Inner Product Space for Matrix

complexMatrixInnerProductSpace : InnerProductSpace (ComplexNumber Float)

Complex Numbered Inner Product Space for Matrix

Matrix Predicates and Properties

Predicate to determine if Matrix is symmetric

Dimension of the matrix

Determine whether a matirx is square

normReal : SquareMatrix Float -> Result String Float

Calculate the norm of a Matrix

normComplex : SquareMatrix (ComplexNumber Float) -> Result String Float

Calculate the norm of a Matrix

distanceReal : SquareMatrix Float -> SquareMatrix Float -> Result String Float

Calculate distance between two vectors

Predicate if matrix is right stochastic

Predicate if matrix is left stochastic

Unitary Operations

Scalar multiplication over a Square Matrix

identity : Field a -> Int -> SquareMatrix a

Create Square Identity Matrix with n dimension

Binary Operations

InnerProductSpace a
-> Result String a

Calculate the dot product of two Matricies

InnerProductSpace a
-> Result String (SquareMatrix a)

Square Matrix Square Matrix multiplication

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

Multiply a Vector by a Matrix

add : Field a -> SquareMatrix a -> SquareMatrix a -> SquareMatrix a

Add two Square Matrices together

Subtract two Square Matrices

Manipulation

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

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