Expand description
Provides general linear algebra methods and matrix decompositions with a focus on low-dimensional data.
Modules§
- cholesky
- Implements Cholesky decomposition.
- lu
- Implements LU decomposition and system solving with the decomposition.
- substitution
- Forward and backward substitution.
Structs§
Enums§
Traits§
Functions§
- arange
- Generates evenly spaced values within a given interval. Values generated in the half-open interval [start, stop). That is, the stop point is not included.
- backward_
substitution - Solve a matrix equation of the form Ux=b, where U is an upper triangular matrix. See the Wikipedia page.
- cholesky
- Computes the Cholesky decomposition of the matrix
a
using the Cholesky-Banachiewicz algorithm. - cholesky_
solve - Solves the system Lx=b, where L is a lower triangular matrix (e.g., a Cholesky decomposed matrix), and b is a one dimensional vector.
- col_
to_ row_ major - Convert a 1D matrix from column-major ordering into row-major ordering.
- design
- Create a design matrix from a given matrix.
- diag
- diag_
matrix - Create a diagonal matrix with the given elements along the elements.
- dot
- Calculates the dot product of two equal-length vectors. When the feature “blas” is enabled,
uses
ddot
from BLAS. Otherwise, uses a length-8 unrolled loop. - forward_
substitution - Solve a matrix equation of the form Lx=b, where L is a lower triangular matrix. See the Wikipedia page.
- inf_
norm - Calculates the infinity norm of a matrix. That is, it sums the absolute values along each row, and then returns the largest of these values.
- invert_
matrix - Given an n by n matrix, invert it. The resulting matrix is returned as a flattened array.
- ipiv_
parity - Calculates the parity of a swap permutation array ipiv (e.g. that you get as an output from Lapack).
- is_
design - Checks whether a 1D array is a valid design matrix, given its number of rows.
- is_
matrix - Checks whether a 1D array is a valid matrix representation given the number of rows.
- is_
positive_ definite - Checks whether a 1d array is a valid positive definite matrix.
- is_
square - Checks whether a 1D array is a valid square matrix.
- is_
symmetric - Checks whether a 1D array is a valid symmetric matrix.
- linspace
- Generates evenly spaced values within a given interval, with a set number of points. Both the start and stop points are included.
- logmeanexp
- Calculates the logarithm of the mean of the exponentials in a stable manner. Applies the LogMeanExp operator (like the LogSumExp, but mean instead of sum) to the array.
- logsumexp
- Calculates the logarithm of the sum of the exponentials in a stable manner. Applies the LogSumExp operator to the array.
- lu
- Computes the pivoted LU decomposition of a square matrix. For some matrix A, this decomposition is A = PLU. The resulting matrix has U in its upper triangle and L in its lower triangle. The unit diagonal elements of L are not stored. The pivot indices representing the permutation matrix P is also returned.
- lu_
solve - Solve the linear system Ax = b given a LU decomposed matrix A. The first argument should be a tuple, where the first element is the LU decomposed matrix and the second element is the pivots P.
- matmatadd
- matmatdiv
- matmatmul
- matmatsub
- matmul
- Multiply two matrices together, optionally transposing one or both of them.
- matmul_
blocked - Performs blocked matrix multiplication with block size
bsize
. See the API for the matmul. - norm
- Calculates the norm of a vector.
- prod
- Calculates the product of a vector.
- rotation_
matrix_ ccw - Returns a 3D counter-clockwise rotation matrix along the
axis
axis (either X, Y, or Z) with a given angle in radians. - rotation_
matrix_ cw - Returns a 3D clockwise rotation matrix along the
axis
axis (either X, Y, or Z) with a given angle in radians. - row_
to_ col_ major - Convert a 1D matrix from row-major ordering into column-major ordering.
- solve
- Solve the linear system Ax = b.
- solve_
sys - Solves a system of linear scalar equations.
a
must represent a square matrix. - sum
- Calculates the sum of a vector.
- toeplitz
- Given a vector of length n, creates n stacked duplicates, resulting in a square Toeplitz matrix. This function also assumes evenness. That is, x_i = x_{-i}.
- transpose
- Transpose a matrix.
- vandermonde
- Given some length m data x, create an nth order Vandermonde matrix.
- xtx
- Given a matrix X with k rows, return X transpose times X, which is a symmetric matrix.