Class LuUpLooking_FSCC
- All Implemented Interfaces:
DecompositionInterface<FMatrixSparseCSC>,DecompositionSparseInterface<FMatrixSparseCSC>,LUDecomposition<FMatrixSparseCSC>,LUSparseDecomposition<FMatrixSparseCSC>,LUSparseDecomposition_F32<FMatrixSparseCSC>
FMatrixSparseCSC.
NOTE: Based mostly on the algorithm described on page 86 in csparse. cs_lu
NOTE: See in code comment for a modification from csparse.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionComputes the matrix's determinant using the LU decomposition.booleanComputes the decomposition of the input matrix.getGw()getGxi()getL()getLower(@Nullable FMatrixSparseCSC lower) Returns the L matrix from the decomposition.int[]getPinv()int[]getRowPivot(@Nullable FMatrixSparseCSC pivot) For numerical stability there are often row interchanges.int[]getRowPivotV(@Nullable IGrowArray pivot) Returns the row pivot vectorgetU()getUpper(@Nullable FMatrixSparseCSC upper) Returns the U matrix from the decomposition.booleanChecks if the input matrix toDecompositionInterface.decompose(org.ejml.data.Matrix)is modified during the decomposition process.booleanbooleanReturns true if the decomposition detected a singular matrix.booleanChecks to see if the structure is locked.voidsetStructureLocked(boolean locked) Save results from structural analysis step.
-
Constructor Details
-
LuUpLooking_FSCC
-
-
Method Details
-
decompose
Description copied from interface:DecompositionInterfaceComputes the decomposition of the input matrix. Depending on the implementation the input matrix might be stored internally or modified. If it is modified then the functionDecompositionInterface.inputModified()will return true and the matrix should not be modified until the decomposition is no longer needed.- Specified by:
decomposein interfaceDecompositionInterface<FMatrixSparseCSC>- Parameters:
A- The matrix which is being decomposed. Modification is implementation dependent.- Returns:
- Returns if it was able to decompose the matrix.
-
computeDeterminant
Description copied from interface:LUSparseDecomposition_F32Computes the matrix's determinant using the LU decomposition.- Specified by:
computeDeterminantin interfaceLUSparseDecomposition_F32<FMatrixSparseCSC>- Returns:
- The determinant.
-
getLower
Description copied from interface:LUDecompositionReturns the L matrix from the decomposition. Should only be called after
DecompositionInterface.decompose(org.ejml.data.Matrix)has been called.If parameter 'lower' is not null, then that matrix is used to store the L matrix. Otherwise a new matrix is created.
- Specified by:
getLowerin interfaceLUDecomposition<FMatrixSparseCSC>- Parameters:
lower- Storage for T matrix. If null then a new matrix is returned. Modified.- Returns:
- The L matrix.
-
getUpper
Description copied from interface:LUDecompositionReturns the U matrix from the decomposition. Should only be called after
DecompositionInterface.decompose(org.ejml.data.Matrix)has been called.If parameter 'upper' is not null, then that matrix is used to store the U matrix. Otherwise a new matrix is created.
- Specified by:
getUpperin interfaceLUDecomposition<FMatrixSparseCSC>- Parameters:
upper- Storage for U matrix. If null then a new matrix is returned. Modified.- Returns:
- The U matrix.
-
getRowPivot
Description copied from interface:LUDecompositionFor numerical stability there are often row interchanges. This computes a pivot matrix that will undo those changes.
- Specified by:
getRowPivotin interfaceLUDecomposition<FMatrixSparseCSC>- Parameters:
pivot- Storage for the pivot matrix. If null then a new matrix is returned. Modified.- Returns:
- The pivot matrix.
-
getRowPivotV
Description copied from interface:LUDecompositionReturns the row pivot vector- Specified by:
getRowPivotVin interfaceLUDecomposition<FMatrixSparseCSC>- Parameters:
pivot- (Optional) Storage for pivot vector- Returns:
- The pivot vector
-
isSingular
public boolean isSingular()Description copied from interface:LUDecompositionReturns true if the decomposition detected a singular matrix. This check will not work 100% of the time due to machine precision issues.- Specified by:
isSingularin interfaceLUDecomposition<FMatrixSparseCSC>- Returns:
- True if the matrix is singular and false if it is not.
-
inputModified
public boolean inputModified()Description copied from interface:DecompositionInterfaceChecks if the input matrix toDecompositionInterface.decompose(org.ejml.data.Matrix)is modified during the decomposition process.- Specified by:
inputModifiedin interfaceDecompositionInterface<FMatrixSparseCSC>- Returns:
- true if the input matrix to decompose() is modified.
-
getGxi
-
getGw
-
getPinv
public int[] getPinv() -
getL
-
getU
-
isReduceFill
public boolean isReduceFill() -
getReduceFill
-
getReducePermutation
public int[] getReducePermutation() -
setStructureLocked
public void setStructureLocked(boolean locked) Description copied from interface:DecompositionSparseInterfaceSave results from structural analysis step. This can reduce computations if a matrix with the exactly same non-zero pattern is decomposed in the future. If a matrix has yet to be processed then the structure of the next matrix is saved. If a matrix has already been processed then the structure of the most recently processed matrix will be saved.
- Specified by:
setStructureLockedin interfaceDecompositionSparseInterface<FMatrixSparseCSC>
-
isStructureLocked
public boolean isStructureLocked()Description copied from interface:DecompositionSparseInterfaceChecks to see if the structure is locked.- Specified by:
isStructureLockedin interfaceDecompositionSparseInterface<FMatrixSparseCSC>- Returns:
- true if locked or false if not locked.
-