Class DenseMatrix.CholeskyFactorization
java.lang.Object
org.tribuo.math.la.DenseMatrix.CholeskyFactorization
- All Implemented Interfaces:
Matrix.Factorization
- Enclosing class:
DenseMatrix
public static final class DenseMatrix.CholeskyFactorization
extends Object
implements Matrix.Factorization
The output of a successful Cholesky factorization.
Essentially wraps a DenseMatrix, but has additional
operations which allow more efficient implementations when the
matrix is known to be the result of a Cholesky factorization.
Mutating the wrapped matrix will cause undefined behaviour in the methods of this class.
May be refactored into a record in the future.
-
Method Summary
Modifier and TypeMethodDescriptiondoubleCompute the matrix determinant of the factorized matrix.intdim1()First dimension of the factorized matrix.intdim2()Second dimension of the factorized matrix.lMatrix()The lower triangular factorized matrix.Solves the system A * X = B, where B is the input matrix, and A is the matrix which produced this Cholesky factorization.Solves a system of linear equations A * b = y, where y is the input vector, A is the matrix which produced this Cholesky factorization, and b is the returned value.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.tribuo.math.la.Matrix.Factorization
inverse
-
Method Details
-
lMatrix
The lower triangular factorized matrix.- Returns:
- The factorization matrix.
-
dim1
public int dim1()Description copied from interface:Matrix.FactorizationFirst dimension of the factorized matrix.- Specified by:
dim1in interfaceMatrix.Factorization- Returns:
- First dimension size.
-
dim2
public int dim2()Description copied from interface:Matrix.FactorizationSecond dimension of the factorized matrix.- Specified by:
dim2in interfaceMatrix.Factorization- Returns:
- Second dimension size.
-
determinant
public double determinant()Compute the matrix determinant of the factorized matrix.- Specified by:
determinantin interfaceMatrix.Factorization- Returns:
- The matrix determinant.
-
solve
Solves a system of linear equations A * b = y, where y is the input vector, A is the matrix which produced this Cholesky factorization, and b is the returned value.- Specified by:
solvein interfaceMatrix.Factorization- Parameters:
vector- The input vector y.- Returns:
- The vector b.
-
solve
Solves the system A * X = B, where B is the input matrix, and A is the matrix which produced this Cholesky factorization.- Specified by:
solvein interfaceMatrix.Factorization- Parameters:
matrix- The input matrix B.- Returns:
- The matrix X.
-