Package edu.wpi.first.math
Class SimpleMatrixUtils
java.lang.Object
edu.wpi.first.math.SimpleMatrixUtils
public final class SimpleMatrixUtils extends Object
-
Method Summary
Modifier and Type Method Description static org.ejml.simple.SimpleMatrix
exp(org.ejml.simple.SimpleMatrix A)
Computes the matrix exponential using Eigen's solver.static org.ejml.simple.SimpleMatrix
expm(org.ejml.simple.SimpleMatrix matrix)
Compute the matrix exponential, e^M of the given matrix.static org.ejml.simple.SimpleMatrix
eye(int rows)
The identy of a square matrix.static org.ejml.simple.SimpleMatrix
lltDecompose(org.ejml.simple.SimpleMatrix src)
Decompose the given matrix using Cholesky Decomposition and return a view of the upper triangular matrix (if you want lower triangular see the other overload of this method.) If the input matrix is zeros, this will return the zero matrix.static org.ejml.simple.SimpleMatrix
lltDecompose(org.ejml.simple.SimpleMatrix src, boolean lowerTriangular)
Decompose the given matrix using Cholesky Decomposition.
-
Method Details
-
expm
Compute the matrix exponential, e^M of the given matrix.- Parameters:
matrix
- The matrix to compute the exponential of.- Returns:
- The resultant matrix.
-
eye
The identy of a square matrix.- Parameters:
rows
- the number of rows (and columns)- Returns:
- the identiy matrix, rows x rows.
-
lltDecompose
Decompose the given matrix using Cholesky Decomposition and return a view of the upper triangular matrix (if you want lower triangular see the other overload of this method.) If the input matrix is zeros, this will return the zero matrix.- Parameters:
src
- The matrix to decompose.- Returns:
- The decomposed matrix.
- Throws:
RuntimeException
- if the matrix could not be decomposed (ie. is not positive semidefinite).
-
lltDecompose
public static org.ejml.simple.SimpleMatrix lltDecompose(org.ejml.simple.SimpleMatrix src, boolean lowerTriangular)Decompose the given matrix using Cholesky Decomposition. If the input matrix is zeros, this will return the zero matrix.- Parameters:
src
- The matrix to decompose.lowerTriangular
- if we want to decompose to the lower triangular Cholesky matrix.- Returns:
- The decomposed matrix.
- Throws:
RuntimeException
- if the matrix could not be decomposed (ie. is not positive semidefinite).
-
exp
Computes the matrix exponential using Eigen's solver.- Parameters:
A
- the matrix to exponentiate.- Returns:
- the exponential of A.
-