Class LUDecompositionCommonsResult
- java.lang.Object
-
- com.opengamma.strata.math.impl.linearalgebra.LUDecompositionCommonsResult
-
- All Implemented Interfaces:
LUDecompositionResult,DecompositionResult
public class LUDecompositionCommonsResult extends Object implements LUDecompositionResult
Wrapper for results of the Commons implementation of LU decomposition (LUDecompositionCommons).
-
-
Constructor Summary
Constructors Constructor Description LUDecompositionCommonsResult(org.apache.commons.math3.linear.LUDecomposition lu)Creates an instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doublegetDeterminant()Return the determinant of the matrix.DoubleMatrixgetL()Returns the $\mathbf{L}$ matrix of the decomposition.DoubleMatrixgetP()Returns the rows permutation matrix, $\mathbf{P}$.int[]getPivot()Returns the pivot permutation vector.DoubleMatrixgetU()Returns the $\mathbf{U}$ matrix of the decomposition.double[]solve(double[] b)Solves $\mathbf{A}x = b$ where $\mathbf{A}$ is a (decomposed) matrix and $b$ is a vector.DoubleArraysolve(DoubleArray b)Solves $\mathbf{A}x = b$ where $\mathbf{A}$ is a (decomposed) matrix and $b$ is a vector.DoubleMatrixsolve(DoubleMatrix b)Solves $\mathbf{A}x = \mathbf{B}$ where $\mathbf{A}$ is a (decomposed) matrix and $\mathbf{B}$ is a matrix.
-
-
-
Method Detail
-
getDeterminant
public double getDeterminant()
Return the determinant of the matrix.- Specified by:
getDeterminantin interfaceLUDecompositionResult- Returns:
- determinant of the matrix
-
getL
public DoubleMatrix getL()
Returns the $\mathbf{L}$ matrix of the decomposition.$\mathbf{L}$ is a lower-triangular matrix.
- Specified by:
getLin interfaceLUDecompositionResult- Returns:
- the $\mathbf{L}$ matrix
-
getP
public DoubleMatrix getP()
Returns the rows permutation matrix, $\mathbf{P}$.P is a sparse matrix with exactly one element set to 1.0 in each row and each column, all other elements being set to 0.0.
The positions of the 1 elements are given by the
pivot permutation vector.- Specified by:
getPin interfaceLUDecompositionResult- Returns:
- the $\mathbf{P}$ rows permutation matrix
- See Also:
LUDecompositionResult.getPivot()
-
getPivot
public int[] getPivot()
Returns the pivot permutation vector.- Specified by:
getPivotin interfaceLUDecompositionResult- Returns:
- the pivot permutation vector
-
getU
public DoubleMatrix getU()
Returns the $\mathbf{U}$ matrix of the decomposition.$\mathbf{U}$ is an upper-triangular matrix.
- Specified by:
getUin interfaceLUDecompositionResult- Returns:
- the U matrix
-
solve
public DoubleArray solve(DoubleArray b)
Solves $\mathbf{A}x = b$ where $\mathbf{A}$ is a (decomposed) matrix and $b$ is a vector.- Specified by:
solvein interfaceDecompositionResult- Parameters:
b- the vector to calculate with- Returns:
- the vector x
-
solve
public double[] solve(double[] b)
Solves $\mathbf{A}x = b$ where $\mathbf{A}$ is a (decomposed) matrix and $b$ is a vector.- Specified by:
solvein interfaceDecompositionResult- Parameters:
b- the vector to calculate with- Returns:
- the vector x
-
solve
public DoubleMatrix solve(DoubleMatrix b)
Solves $\mathbf{A}x = \mathbf{B}$ where $\mathbf{A}$ is a (decomposed) matrix and $\mathbf{B}$ is a matrix.- Specified by:
solvein interfaceDecompositionResult- Parameters:
b- the matrix to calculate with- Returns:
- the matrix x
-
-