public class LinearSolverQrHouseCol_ZDRM extends LinearSolverAbstract_ZDRM
QR decomposition can be used to solve for systems. However, this is not as computationally efficient as LU decomposition and costs about 3n2 flops.
It solve for x by first multiplying b by the transpose of Q then solving for the result.
QRx=b
Rx=Q^H b
A column major decomposition is used in this solver.
Modifier and Type | Field and Description |
---|---|
protected int |
maxCols |
protected int |
maxRows |
A, numCols, numRows, stride
Constructor and Description |
---|
LinearSolverQrHouseCol_ZDRM()
Creates a linear solver that uses QR decomposition.
|
Modifier and Type | Method and Description |
---|---|
QRDecompositionHouseholderColumn_ZDRM |
getDecomposition() |
boolean |
modifiesA() |
boolean |
modifiesB() |
double |
quality() |
boolean |
setA(org.ejml.data.ZMatrixRMaj A)
Performs QR decomposition on A
|
void |
setMaxSize(int maxRows,
int maxCols) |
void |
solve(org.ejml.data.ZMatrixRMaj B,
org.ejml.data.ZMatrixRMaj X)
Solves for X using the QR decomposition.
|
_setA, getA, invert
public LinearSolverQrHouseCol_ZDRM()
public void setMaxSize(int maxRows, int maxCols)
public boolean setA(org.ejml.data.ZMatrixRMaj A)
A
- not modified.public double quality()
public void solve(org.ejml.data.ZMatrixRMaj B, org.ejml.data.ZMatrixRMaj X)
B
- A matrix that is n by m. Not modified.X
- An n by m matrix where the solution is written to. Modified.public boolean modifiesA()
public boolean modifiesB()
public QRDecompositionHouseholderColumn_ZDRM getDecomposition()