public class QRHouseColSolver extends Object
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^T b
A column major decomposition is used in this solver.
| Modifier and Type | Field and Description |
|---|---|
protected AMatrix |
A |
protected int |
maxCols |
protected int |
maxRows |
protected int |
numCols |
protected int |
numRows |
| Constructor and Description |
|---|
QRHouseColSolver()
Creates a linear solver that uses QR decomposition.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
_setA(AMatrix A) |
AMatrix |
getA() |
double |
quality() |
static double |
qualityTriangular(boolean upper,
AMatrix T)
Computes the quality of a triangular matrix.
|
boolean |
setA(AMatrix A)
Performs QR decomposition on A
|
void |
setMaxSize(int maxRows,
int maxCols) |
AMatrix |
solve(AMatrix B)
Solves for X using the QR decomposition.
|
protected AMatrix A
protected int numRows
protected int numCols
protected int maxRows
protected int maxCols
public QRHouseColSolver()
public AMatrix getA()
protected void _setA(AMatrix A)
public void setMaxSize(int maxRows,
int maxCols)
public boolean setA(AMatrix A)
A - not modified.public double quality()
public AMatrix solve(AMatrix B)
B - A matrix that is n by m. Not modified.public static double qualityTriangular(boolean upper,
AMatrix T)
upper - if it is upper triangular or not.T - A matrix. @return product of the diagonal elements.Copyright © 2016. All rights reserved.