public abstract class BaseLinearSolverQrp_DDRM extends LinearSolverAbstract_DDRM
Base class for QR pivot based pseudo inverse classes. It will return either the basic of minimal 2-norm solution. See [1] for details. The minimal 2-norm solution refers to the solution 'x' whose 2-norm is the smallest making it unique, not some other error function.
R = [ R12 R12 ] r P^T*x = [ y ] r Q^T*b = [ c ] r [ 0 0 ] m-r [ z ] n -r [ d ] m-r r n-r where r is the rank of the matrix and (m,n) is the dimension of the linear system.
The solution 'x' is found by solving the system below. The basic solution is found by setting z=0 [ R_11^-1*(c - R12*z) ] x = [ z ]
NOTE: The matrix rank is determined using the provided QR decomposition. [1] mentions that this will not always work and could cause some problems.
[1] See page 258-259 in Gene H. Golub and Charles F. Van Loan "Matrix Computations" 3rd Ed, 1996
Modifier and Type | Field and Description |
---|---|
protected org.ejml.data.DMatrixRMaj |
I |
protected org.ejml.interfaces.linsol.LinearSolverDense<org.ejml.data.DMatrixRMaj> |
internalSolver |
protected boolean |
norm2Solution |
protected org.ejml.data.DMatrixRMaj |
R |
protected org.ejml.data.DMatrixRMaj |
R11 |
protected int |
rank |
protected org.ejml.data.DMatrixRMaj |
Y |
A, numCols, numRows
Modifier | Constructor and Description |
---|---|
protected |
BaseLinearSolverQrp_DDRM(org.ejml.interfaces.decomposition.QRPDecomposition_F64<org.ejml.data.DMatrixRMaj> decomposition,
boolean norm2Solution)
Configures internal parameters.
|
Modifier and Type | Method and Description |
---|---|
org.ejml.interfaces.decomposition.QRPDecomposition_F64<org.ejml.data.DMatrixRMaj> |
getDecomposition() |
void |
invert(org.ejml.data.DMatrixRMaj A_inv) |
double |
quality() |
boolean |
setA(org.ejml.data.DMatrixRMaj A) |
protected void |
upgradeSolution(org.ejml.data.DMatrixRMaj X)
Upgrades the basic solution to the optimal 2-norm solution.
|
_setA, getA
protected boolean norm2Solution
protected org.ejml.data.DMatrixRMaj Y
protected org.ejml.data.DMatrixRMaj R
protected org.ejml.data.DMatrixRMaj R11
protected org.ejml.data.DMatrixRMaj I
protected int rank
protected org.ejml.interfaces.linsol.LinearSolverDense<org.ejml.data.DMatrixRMaj> internalSolver
protected BaseLinearSolverQrp_DDRM(org.ejml.interfaces.decomposition.QRPDecomposition_F64<org.ejml.data.DMatrixRMaj> decomposition, boolean norm2Solution)
decomposition
- Used to solve the linear system.norm2Solution
- If true then the optimal 2-norm solution will be computed for degenerate systems.public boolean setA(org.ejml.data.DMatrixRMaj A)
public double quality()
protected void upgradeSolution(org.ejml.data.DMatrixRMaj X)
Upgrades the basic solution to the optimal 2-norm solution.
First solves for 'z' || x_b - P*[ R_11^-1 * R_12 ] * z ||2 min z || [ - I_{n-r} ] ||
X
- basic solution, also output solutionpublic void invert(org.ejml.data.DMatrixRMaj A_inv)
invert
in interface org.ejml.interfaces.linsol.LinearSolverDense<org.ejml.data.DMatrixRMaj>
invert
in class LinearSolverAbstract_DDRM
public org.ejml.interfaces.decomposition.QRPDecomposition_F64<org.ejml.data.DMatrixRMaj> getDecomposition()