Class CholeskyDecompositionCommon_FDRM
java.lang.Object
org.ejml.dense.row.decomposition.chol.CholeskyDecompositionCommon_FDRM
- All Implemented Interfaces:
CholeskyDecomposition<FMatrixRMaj>
,CholeskyDecomposition_F32<FMatrixRMaj>
,DecompositionInterface<FMatrixRMaj>
- Direct Known Subclasses:
CholeskyDecompositionBlock_FDRM
,CholeskyDecompositionInner_FDRM
@Generated("org.ejml.dense.row.decomposition.chol.CholeskyDecompositionCommon_DDRM")
public abstract class CholeskyDecompositionCommon_FDRM
extends Object
implements CholeskyDecomposition_F32<FMatrixRMaj>
This is an abstract class for a Cholesky decomposition. It provides the solvers, but the actual decomposition is provided in other classes.
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprotected Complex_F32
protected boolean
protected int
protected int
protected float[]
protected FMatrixRMaj
protected float[]
-
Constructor Summary
ModifierConstructorDescriptionprotected
CholeskyDecompositionCommon_FDRM
(boolean lower) Specifies if a lower or upper variant should be constructed. -
Method Summary
Modifier and TypeMethodDescriptionfloat[]
_getVV()
Computes the matrix's determinant using the decomposition.boolean
decompose
(FMatrixRMaj mat) Performs Choleksy decomposition on the provided matrix.protected abstract boolean
Performs an lower triangular decomposition.protected abstract boolean
Performs an upper triangular decomposition.getT()
Returns the triangular matrix from the decomposition.getT
(@Nullable FMatrixRMaj T) Returns the triangular matrix from the decomposition.boolean
Checks if the input matrix toDecompositionInterface.decompose(org.ejml.data.Matrix)
is modified during the decomposition process.boolean
isLower()
If true the decomposition was for a lower triangular matrix.void
setExpectedMaxSize
(int numRows, int numCols)
-
Field Details
-
maxWidth
protected int maxWidth -
n
protected int n -
T
-
t
protected float[] t -
vv
protected float[] vv -
lower
protected boolean lower -
det
-
-
Constructor Details
-
CholeskyDecompositionCommon_FDRM
protected CholeskyDecompositionCommon_FDRM(boolean lower) Specifies if a lower or upper variant should be constructed.- Parameters:
lower
- should a lower or upper triangular matrix be used.
-
-
Method Details
-
setExpectedMaxSize
public void setExpectedMaxSize(int numRows, int numCols) -
isLower
public boolean isLower()If true the decomposition was for a lower triangular matrix. If false it was for an upper triangular matrix.- Specified by:
isLower
in interfaceCholeskyDecomposition<FMatrixRMaj>
- Returns:
- True if lower, false if upper.
-
decompose
Performs Choleksy decomposition on the provided matrix.
If the matrix is not positive definite then this function will return false since it can't complete its computations. Not all errors will be found. This is an efficient way to check for positive definiteness.
- Specified by:
decompose
in interfaceDecompositionInterface<FMatrixRMaj>
- Parameters:
mat
- A symmetric positive definite matrix with n ≤ widthMax.- Returns:
- True if it was able to finish the decomposition.
-
inputModified
public boolean inputModified()Description copied from interface:DecompositionInterface
Checks if the input matrix toDecompositionInterface.decompose(org.ejml.data.Matrix)
is modified during the decomposition process.- Specified by:
inputModified
in interfaceDecompositionInterface<FMatrixRMaj>
- Returns:
- true if the input matrix to decompose() is modified.
-
decomposeLower
protected abstract boolean decomposeLower()Performs an lower triangular decomposition.- Returns:
- true if the matrix was decomposed.
-
decomposeUpper
protected abstract boolean decomposeUpper()Performs an upper triangular decomposition.- Returns:
- true if the matrix was decomposed.
-
getT
Description copied from interface:CholeskyDecomposition
Returns the triangular matrix from the decomposition.
If an input is provided that matrix is used to write the results to. Otherwise a new matrix is created and the results written to it.
- Specified by:
getT
in interfaceCholeskyDecomposition<FMatrixRMaj>
- Parameters:
T
- If not null then the decomposed matrix is written here.- Returns:
- A lower or upper triangular matrix.
-
getT
Returns the triangular matrix from the decomposition.- Returns:
- A lower or upper triangular matrix.
-
_getVV
public float[] _getVV() -
computeDeterminant
Description copied from interface:CholeskyDecomposition_F32
Computes the matrix's determinant using the decomposition.- Specified by:
computeDeterminant
in interfaceCholeskyDecomposition_F32<FMatrixRMaj>
- Returns:
- The determinant.
-