Class LUDecompositionBase_DDRM
java.lang.Object
org.ejml.dense.row.decomposition.lu.LUDecompositionBase_DDRM
- All Implemented Interfaces:
DecompositionInterface<DMatrixRMaj>
,LUDecomposition<DMatrixRMaj>
,LUDecomposition_F64<DMatrixRMaj>
- Direct Known Subclasses:
LUDecompositionAlt_DDRM
public abstract class LUDecompositionBase_DDRM
extends Object
implements LUDecomposition_F64<DMatrixRMaj>
Contains common data structures and operations for LU decomposition algorithms.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiondouble[]
_getVV()
void
_solveVectorInternal
(double[] vv) a specialized version of solve that avoid additional checks that are not needed.Computes the determinant from the LU decomposition.protected void
int[]
getIndx()
getLower
(@Nullable DMatrixRMaj lower) Writes the lower triangular matrix into the specified matrix.getLU()
int[]
getPivot()
getRowPivot
(@Nullable DMatrixRMaj pivot) For numerical stability there are often row interchanges.int[]
getRowPivotV
(@Nullable IGrowArray pivot) Returns the row pivot vectorgetUpper
(@Nullable DMatrixRMaj upper) Writes the upper triangular matrix into the specified matrix.boolean
Checks if the input matrix toDecompositionInterface.decompose(org.ejml.data.Matrix)
is modified during the decomposition process.boolean
Determines if the decomposed matrix is singular.double
quality()
void
setExpectedMaxSize
(int numRows, int numCols) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.ejml.interfaces.decomposition.DecompositionInterface
decompose
-
Field Details
-
LU
-
maxWidth
protected int maxWidth -
m
protected int m -
n
protected int n -
dataLU
protected double[] dataLU -
vv
protected double[] vv -
indx
protected int[] indx -
pivot
protected int[] pivot -
pivsign
protected double pivsign
-
-
Constructor Details
-
LUDecompositionBase_DDRM
public LUDecompositionBase_DDRM()
-
-
Method Details
-
setExpectedMaxSize
public void setExpectedMaxSize(int numRows, int numCols) -
getLU
-
getIndx
public int[] getIndx() -
getPivot
public int[] getPivot() -
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<DMatrixRMaj>
- Returns:
- true if the input matrix to decompose() is modified.
-
getLower
Writes the lower triangular matrix into the specified matrix.- Specified by:
getLower
in interfaceLUDecomposition<DMatrixRMaj>
- Parameters:
lower
- Where the lower triangular matrix is written to.- Returns:
- The L matrix.
-
getUpper
Writes the upper triangular matrix into the specified matrix.- Specified by:
getUpper
in interfaceLUDecomposition<DMatrixRMaj>
- Parameters:
upper
- Where the upper triangular matrix is writen to.- 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<DMatrixRMaj>
- 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<DMatrixRMaj>
- Parameters:
pivot
- (Optional) Storage for pivot vector- Returns:
- The pivot vector
-
decomposeCommonInit
-
isSingular
public boolean isSingular()Determines if the decomposed matrix is singular. This function can return false and the matrix be almost singular, which is still bad.- Specified by:
isSingular
in interfaceLUDecomposition<DMatrixRMaj>
- Returns:
- true if singular false otherwise.
-
computeDeterminant
Computes the determinant from the LU decomposition.- Specified by:
computeDeterminant
in interfaceLUDecomposition_F64<DMatrixRMaj>
- Returns:
- The matrix's determinant.
-
quality
public double quality() -
_solveVectorInternal
public void _solveVectorInternal(double[] vv) a specialized version of solve that avoid additional checks that are not needed. -
_getVV
public double[] _getVV()
-