Class QRDecompositionCommonsResult
- java.lang.Object
-
- com.opengamma.strata.math.impl.linearalgebra.QRDecompositionCommonsResult
-
- All Implemented Interfaces:
QRDecompositionResult
,DecompositionResult
public class QRDecompositionCommonsResult extends Object implements QRDecompositionResult
Wrapper for results of the Commons implementation of QR Decomposition (QRDecompositionCommons
).
-
-
Constructor Summary
Constructors Constructor Description QRDecompositionCommonsResult(org.apache.commons.math3.linear.QRDecomposition qr)
Creates an instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DoubleMatrix
getQ()
Returns the matrix $\mathbf{Q}$ of the decomposition.DoubleMatrix
getQT()
Returns the transpose of the matrix $\mathbf{Q}$ of the decomposition.DoubleMatrix
getR()
Returns the matrix $\mathbf{R}$ of the decomposition.double[]
solve(double[] b)
Solves $\mathbf{A}x = b$ where $\mathbf{A}$ is a (decomposed) matrix and $b$ is a vector.DoubleArray
solve(DoubleArray b)
Solves $\mathbf{A}x = b$ where $\mathbf{A}$ is a (decomposed) matrix and $b$ is a vector.DoubleMatrix
solve(DoubleMatrix b)
Solves $\mathbf{A}x = \mathbf{B}$ where $\mathbf{A}$ is a (decomposed) matrix and $\mathbf{B}$ is a matrix.
-
-
-
Method Detail
-
getQ
public DoubleMatrix getQ()
Returns the matrix $\mathbf{Q}$ of the decomposition.$\mathbf{Q}$ is an orthogonal matrix.
- Specified by:
getQ
in interfaceQRDecompositionResult
- Returns:
- the $\mathbf{Q}$ matrix
-
getQT
public DoubleMatrix getQT()
Returns the transpose of the matrix $\mathbf{Q}$ of the decomposition.$\mathbf{Q}$ is an orthogonal matrix.
- Specified by:
getQT
in interfaceQRDecompositionResult
- Returns:
- the $\mathbf{Q}$ matrix
-
getR
public DoubleMatrix getR()
Returns the matrix $\mathbf{R}$ of the decomposition.$\mathbf{R}$ is an upper-triangular matrix.
- Specified by:
getR
in interfaceQRDecompositionResult
- Returns:
- the $\mathbf{R}$ 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:
solve
in 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:
solve
in 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:
solve
in interfaceDecompositionResult
- Parameters:
b
- the matrix to calculate with- Returns:
- the matrix x
-
-