Class LuUpLooking_DSCC
- All Implemented Interfaces:
DecompositionInterface<DMatrixSparseCSC>
,DecompositionSparseInterface<DMatrixSparseCSC>
,LUDecomposition<DMatrixSparseCSC>
,LUSparseDecomposition<DMatrixSparseCSC>
,LUSparseDecomposition_F64<DMatrixSparseCSC>
DMatrixSparseCSC
.
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
-
Method Summary
Modifier and TypeMethodDescriptionComputes the matrix's determinant using the LU decomposition.boolean
Computes the decomposition of the input matrix.getGw()
getGxi()
getL()
getLower
(@Nullable DMatrixSparseCSC lower) Returns the L matrix from the decomposition.int[]
getPinv()
int[]
getRowPivot
(@Nullable DMatrixSparseCSC pivot) For numerical stability there are often row interchanges.int[]
getRowPivotV
(@Nullable IGrowArray pivot) Returns the row pivot vectorgetU()
getUpper
(@Nullable DMatrixSparseCSC upper) Returns the U matrix from the decomposition.boolean
Checks if the input matrix toDecompositionInterface.decompose(org.ejml.data.Matrix)
is modified during the decomposition process.boolean
boolean
Returns true if the decomposition detected a singular matrix.boolean
Checks to see if the structure is locked.void
setStructureLocked
(boolean locked) Save results from structural analysis step.
-
Constructor Details
-
LuUpLooking_DSCC
-
-
Method Details
-
decompose
Description copied from interface:DecompositionInterface
Computes 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:
decompose
in interfaceDecompositionInterface<DMatrixSparseCSC>
- 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_F64
Computes the matrix's determinant using the LU decomposition.- Specified by:
computeDeterminant
in interfaceLUSparseDecomposition_F64<DMatrixSparseCSC>
- Returns:
- The determinant.
-
getLower
Description copied from interface:LUDecomposition
Returns 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:
getLower
in interfaceLUDecomposition<DMatrixSparseCSC>
- Parameters:
lower
- Storage for T matrix. If null then a new matrix is returned. Modified.- Returns:
- The L matrix.
-
getUpper
Description copied from interface:LUDecomposition
Returns 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:
getUpper
in interfaceLUDecomposition<DMatrixSparseCSC>
- Parameters:
upper
- Storage for U matrix. If null then a new matrix is returned. Modified.- Returns:
- The U matrix.
-
getRowPivot
Description copied from interface:LUDecomposition
For numerical stability there are often row interchanges. This computes a pivot matrix that will undo those changes.
- Specified by:
getRowPivot
in interfaceLUDecomposition<DMatrixSparseCSC>
- 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:LUDecomposition
Returns the row pivot vector- Specified by:
getRowPivotV
in interfaceLUDecomposition<DMatrixSparseCSC>
- Parameters:
pivot
- (Optional) Storage for pivot vector- Returns:
- The pivot vector
-
isSingular
public boolean isSingular()Description copied from interface:LUDecomposition
Returns true if the decomposition detected a singular matrix. This check will not work 100% of the time due to machine precision issues.- Specified by:
isSingular
in interfaceLUDecomposition<DMatrixSparseCSC>
- Returns:
- True if the matrix is singular and false if it is not.
-
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<DMatrixSparseCSC>
- 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:DecompositionSparseInterface
Save 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:
setStructureLocked
in interfaceDecompositionSparseInterface<DMatrixSparseCSC>
-
isStructureLocked
public boolean isStructureLocked()Description copied from interface:DecompositionSparseInterface
Checks to see if the structure is locked.- Specified by:
isStructureLocked
in interfaceDecompositionSparseInterface<DMatrixSparseCSC>
- Returns:
- true if locked or false if not locked.
-