Idris2Doc : Data.NumIdr.Matrix

Data.NumIdr.Matrix

(source)

Reexports

importpublic Data.NumIdr.Array

Definitions

Matrix : Nat->Nat->Type->Type
  A matrix is a rank-2 array.

Totality: total
Visibility: public export
Matrix' : Nat->Type->Type
  A synonym for a square matrix with dimensions of length `n`.

Totality: total
Visibility: public export
matrix : {defaultBrep : Rep} ->RepConstraintrepa=>Vectm (Vectna) ->Matrixmna
  Construct a matrix with the given order and elements.

Totality: total
Visibility: export
repeatDiag : {defaultBrep : Rep} ->RepConstraintrepa=>a->a->Matrixmna
  Construct a matrix with a specific value along the diagonal.

@ diag The value to repeat along the diagonal
@ other The value to repeat elsewhere

Totality: total
Visibility: export
fromDiag : {defaultBrep : Rep} ->RepConstraintrepa=>Vect (minimummn) a->a->Matrixmna
  Construct a matrix given its diagonal elements.

@ diag The elements of the matrix's diagonal
@ other The value to repeat elsewhere

Totality: total
Visibility: export
permuteM : {defaultBrep : Rep} ->RepConstraintrepa=>Numa=>Permutationn->Matrix'na
  Construct a permutation matrix based on the given permutation.

Totality: total
Visibility: export
scale : {defaultBrep : Rep} ->RepConstraintrepa=>Numa=>a->Matrix'na
  Construct the matrix that scales a vector by the given value.

Totality: total
Visibility: export
rotate2D : {defaultBrep : Rep} ->RepConstraintrepDouble=>Double->Matrix'2Double
  Construct a 2D rotation matrix that rotates by the given angle (in radians).

Totality: total
Visibility: export
rotate3DX : {defaultBrep : Rep} ->RepConstraintrepDouble=>Double->Matrix'3Double
  Construct a 3D rotation matrix around the x-axis.

Totality: total
Visibility: export
rotate3DY : {defaultBrep : Rep} ->RepConstraintrepDouble=>Double->Matrix'3Double
  Construct a 3D rotation matrix around the y-axis.

Totality: total
Visibility: export
rotate3DZ : {defaultBrep : Rep} ->RepConstraintrepDouble=>Double->Matrix'3Double
  Construct a 3D rotation matrix around the z-axis.

Totality: total
Visibility: export
reflect : {defaultBrep : Rep} ->RepConstraintrepa=>Nega=>Finn->Matrix'na
Totality: total
Visibility: export
reflectX : {defaultBrep : Rep} ->RepConstraintrepa=>Nega=>Matrix' (1+n) a
Totality: total
Visibility: export
reflectY : {defaultBrep : Rep} ->RepConstraintrepa=>Nega=>Matrix' (2+n) a
Totality: total
Visibility: export
reflectZ : {defaultBrep : Rep} ->RepConstraintrepa=>Nega=>Matrix' (3+n) a
Totality: total
Visibility: export
index : Finm->Finn->Matrixmna->a
  Index the matrix at the given coordinates.

Totality: total
Visibility: export
indexNB : Nat->Nat->Matrixmna->Maybea
  Index the matrix at the given coordinates, returning `Nothing` if the
coordinates are out of bounds.

Totality: total
Visibility: export
getRow : Finm->Matrixmna->Vectorna
  Return a row of the matrix as a vector.

Totality: total
Visibility: export
getColumn : Finn->Matrixmna->Vectorma
  Return a column of the matrix as a vector.

Totality: total
Visibility: export
diagonal' : Matrixmna->Vector (minimummn) a
  Return the diagonal elements of the matrix as a vector.

Totality: total
Visibility: export
diagonal : Matrix'na->Vectorna
  Return the diagonal elements of the matrix as a vector.

Totality: total
Visibility: export
minor : Fin (Sm) ->Fin (Sn) ->Matrix (Sm) (Sn) a->Matrixmna
  Return a minor of the matrix, i.e. the matrix formed by removing a
single row and column.

Totality: total
Visibility: export
upperTriangle : Numa=>Matrixmna->Matrixmna
Totality: total
Visibility: export
lowerTriangle : Numa=>Matrixmna->Matrixmna
Totality: total
Visibility: export
upperTriangleStrict : Numa=>Matrixmna->Matrixmna
Totality: total
Visibility: export
lowerTriangleStrict : Numa=>Matrixmna->Matrixmna
Totality: total
Visibility: export
vconcat : Matrixmna->Matrixm'na->Matrix (m+m') na
  Concatenate two matrices vertically.

Totality: total
Visibility: export
hconcat : Matrixmna->Matrixmn'a->Matrixm (n+n') a
  Concatenate two matrices horizontally.

Totality: total
Visibility: export
vstack : Vectm (Vectorna) ->Matrixmna
  Stack row vectors to form a matrix.

Totality: total
Visibility: export
hstack : Vectn (Vectorma) ->Matrixmna
  Stack column vectors to form a matrix.

Totality: total
Visibility: export
swapRows : Finm->Finm->Matrixmna->Matrixmna
  Swap two rows of a matrix.

Totality: total
Visibility: export
swapColumns : Finn->Finn->Matrixmna->Matrixmna
  Swap two columns of a matrix.

Totality: total
Visibility: export
permuteRows : Permutationm->Matrixmna->Matrixmna
  Permute the rows of a matrix.

Totality: total
Visibility: export
permuteColumns : Permutationn->Matrixmna->Matrixmna
  Permute the columns of a matrix.

Totality: total
Visibility: export
outer : Numa=>Vectorma->Vectorna->Matrixmna
  Calculate the outer product of two vectors as a matrix.

Totality: total
Visibility: export
trace : Numa=>Matrixmna->a
  Calculate the trace of a matrix, i.e. the sum of its diagonal elements.

Totality: total
Visibility: export
reflectNormal : (Nega, Fractionala) =>Vectorna->Matrix'na
  Construct a matrix that reflects a vector along a hyperplane of the
given normal vector. The input does not have to be a unit vector.

Totality: total
Visibility: export
recordDecompLU : Matrixmna->Type
  The LU decomposition of a matrix.

LU decomposition factors a matrix A into two matrices: a lower triangular
matrix L, and an upper triangular matrix U, such that A = LU.

Totality: total
Visibility: export
Constructor: 
MkLU : Matrixmna->DecompLUmat

Projections:
.lower : Numa=>DecompLUmat->Matrixm (minimummn) a
  The lower triangular matrix L of the LU decomposition.
.lower' : Numa=>DecompLUmat->Matrix'na
  The lower triangular matrix L of the LU decomposition.

This accessor is intended to be used for square matrix decompositions.
.lu : DecompLUmat->Matrixmna
.upper : Numa=>DecompLUmat->Matrix (minimummn) na
  The upper triangular matrix U of the LU decomposition.
.upper' : Numa=>DecompLUmat->Matrix'na
  The upper triangular matrix U of the LU decomposition.

This accessor is intended to be used for square matrix decompositions.
lower : Numa=>DecompLUmat->Matrixm (minimummn) a
  The lower triangular matrix L of the LU decomposition.

Totality: total
Visibility: export
.lower : Numa=>DecompLUmat->Matrixm (minimummn) a
  The lower triangular matrix L of the LU decomposition.

Totality: total
Visibility: export
lower' : Numa=>DecompLUmat->Matrix'na
  The lower triangular matrix L of the LU decomposition.

This accessor is intended to be used for square matrix decompositions.

Totality: total
Visibility: export
.lower' : Numa=>DecompLUmat->Matrix'na
  The lower triangular matrix L of the LU decomposition.

This accessor is intended to be used for square matrix decompositions.

Totality: total
Visibility: export
upper : Numa=>DecompLUmat->Matrix (minimummn) na
  The upper triangular matrix U of the LU decomposition.

Totality: total
Visibility: export
.upper : Numa=>DecompLUmat->Matrix (minimummn) na
  The upper triangular matrix U of the LU decomposition.

Totality: total
Visibility: export
upper' : Numa=>DecompLUmat->Matrix'na
  The upper triangular matrix U of the LU decomposition.

This accessor is intended to be used for square matrix decompositions.

Totality: total
Visibility: export
.upper' : Numa=>DecompLUmat->Matrix'na
  The upper triangular matrix U of the LU decomposition.

This accessor is intended to be used for square matrix decompositions.

Totality: total
Visibility: export
decompLU : Fielda=> (mat : Matrixmna) ->Maybe (DecompLUmat)
  Calculate the LU decomposition of a matrix, returning `Nothing` if one
does not exist.

Totality: total
Visibility: export
recordDecompLUP : Matrixmna->Type
  The LUP decomposition of a matrix.

LUP decomposition is similar to LU decomposition, but the matrix may have
its rows permuted before being factored. More formally, an LUP decomposition
of a matrix A consists of a lower triangular matrix L, an upper triangular
matrix U, and a permutation matrix P, such that PA = LU.

Totality: total
Visibility: export
Constructor: 
MkLUP : Matrixmna->Permutationm->Nat->DecompLUPmat

Projections:
.lower : Numa=>DecompLUPmat->Matrixm (minimummn) a
  The lower triangular matrix L of the LUP decomposition.
.lower' : Numa=>DecompLUPmat->Matrix'na
  The lower triangular matrix L of the LUP decomposition.

This accessor is intended to be used for square matrix decompositions.
.lu : DecompLUPmat->Matrixmna
.p : DecompLUPmat->Permutationm
.permute : DecompLUPmat->Permutationm
  The row permutation of the LUP decomposition.
.sw : DecompLUPmat->Nat
.upper : Numa=>DecompLUPmat->Matrix (minimummn) na
  The upper triangular matrix U of the LUP decomposition.
.upper' : Numa=>DecompLUPmat->Matrix'na
  The upper triangular matrix U of the LUP decomposition.

This accessor is intended to be used for square matrix decompositions.
lower : Numa=>DecompLUPmat->Matrixm (minimummn) a
  The lower triangular matrix L of the LUP decomposition.

Totality: total
Visibility: export
.lower : Numa=>DecompLUPmat->Matrixm (minimummn) a
  The lower triangular matrix L of the LUP decomposition.

Totality: total
Visibility: export
lower' : Numa=>DecompLUPmat->Matrix'na
  The lower triangular matrix L of the LUP decomposition.

This accessor is intended to be used for square matrix decompositions.

Totality: total
Visibility: export
.lower' : Numa=>DecompLUPmat->Matrix'na
  The lower triangular matrix L of the LUP decomposition.

This accessor is intended to be used for square matrix decompositions.

Totality: total
Visibility: export
upper : Numa=>DecompLUPmat->Matrix (minimummn) na
  The upper triangular matrix U of the LUP decomposition.

Totality: total
Visibility: export
.upper : Numa=>DecompLUPmat->Matrix (minimummn) na
  The upper triangular matrix U of the LUP decomposition.

Totality: total
Visibility: export
upper' : Numa=>DecompLUPmat->Matrix'na
  The upper triangular matrix U of the LUP decomposition.

This accessor is intended to be used for square matrix decompositions.

Totality: total
Visibility: export
.upper' : Numa=>DecompLUPmat->Matrix'na
  The upper triangular matrix U of the LUP decomposition.

This accessor is intended to be used for square matrix decompositions.

Totality: total
Visibility: export
permute : DecompLUPmat->Permutationm
  The row permutation of the LUP decomposition.

Totality: total
Visibility: export
.permute : DecompLUPmat->Permutationm
  The row permutation of the LUP decomposition.

Totality: total
Visibility: export
numSwaps : DecompLUPmat->Nat
  The number of swaps in the permutation of the LUP decomposition.

This is stored along with the permutation in order to increase the
efficiency of certain algorithms.

Totality: total
Visibility: export
fromLU : DecompLUmat->DecompLUPmat
  Convert an LU decomposition into an LUP decomposition.

Totality: total
Visibility: export
decompLUP : FieldCmpa=> (mat : Matrixmna) ->DecompLUPmat
  Calculate the LUP decomposition of a matrix.

Totality: total
Visibility: export
detWithLUP : Numa=> (mat : Matrix'na) ->DecompLUPmat->a
  Calculate the determinant of a matrix given its LUP decomposition.

Totality: total
Visibility: export
det : FieldCmpa=>Matrix'na->a
  Calculate the determinant of a matrix.

Totality: total
Visibility: export
solveLowerTri : Fielda=>Matrix'na->Vectorna->Maybe (Vectorna)
  Solve a linear equation, assuming the matrix is lower triangular.
Any entries other than those below the diagonal are ignored.

Totality: total
Visibility: export
solveUpperTri : Fielda=>Matrix'na->Vectorna->Maybe (Vectorna)
  Solve a linear equation, assuming the matrix is upper triangular.
Any entries other than those above the diagonal are ignored.

Totality: total
Visibility: export
solveWithLUP : Fielda=> (mat : Matrix'na) ->DecompLUPmat->Vectorna->Maybe (Vectorna)
  Solve a linear equation, given a matrix and its LUP decomposition.

Totality: total
Visibility: export
solve : FieldCmpa=>Matrix'na->Vectorna->Maybe (Vectorna)
  Solve a linear equation given a matrix.

Totality: total
Visibility: export
invertible : FieldCmpa=>Matrix'na->Bool
  Determine whether a matrix has an inverse.

Totality: total
Visibility: export
tryInverse : FieldCmpa=>Matrix'na->Maybe (Matrix'na)
  Try to invert a square matrix, returning `Nothing` if an inverse
does not exist.

Totality: total
Visibility: export