|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.stanford.rsl.konrad.numerics.DecompositionQR
public class DecompositionQR
Implements a QR decomposition for arbitrary matrices. This functor object allows to decompose any matrix \f$ \mathbf{A} \f$ into matrices \f$ \mathbf{Q} \f$ and \f$ \mathbf{R} \f$ such that \f[ \mathbf{A} = \mathbf{Q} \mathbf{R}. \f] Use it for solving systems of linear equations and for minimization problems (with more equations than variables). The QR decomposition is not suited for computing the set of solutions for an under-determined system of equations (although it may be used to compute one of those solutions). Assuming \f$ \mathbf A \f$ is a \f$ m \times n \f$ matrix, the decomposition is performed such that the matrix \f$ \mathbf Q \f$ has dimensions \f$ m \times m \f$ and is orthogonal and the matrix \f$ \mathbf{R} \f$ has dimensions \f$ m \times n \f$ and has upper triangular form (\f$ r_{i,j} = 0 \f$ for \f$ i>j \f$). Internally, only a compressed version of the factors \f$ \mathbf{Q} \f$ and \f$ \mathbf{R} \f$ is stored which together needs approximately as much space as the original matrix \f$ \mathbf{A} \f$. Usage: \code Nude::Decomposition::QR<> qr; qr(A); qr.solve(b); \endcode \sa RQ \sa Deuflhard/Hohmann: Numerische Mathematik I \sa The development of this code started out with the implementation of TNT/JAMA at http://math.nist.gov/tnt/. However, it was completely revised, optimized, and commented. \author Andreas Keil \todo Handle singularity / do pivoting when decomposing. \todo Improve method isFullRank() to check against an epsilon.
Constructor Summary | |
---|---|
DecompositionQR(SimpleMatrix A)
Constructor performing the actual decomposition of a matrix ![]() |
Method Summary | |
---|---|
SimpleMatrix |
getQ()
Compute Q from the internal storage QR. |
SimpleMatrix |
getR()
Compute R from the internal storages QR and Rdiag. |
boolean |
isFullRank()
Specifies whether the input Matrix ![]() |
SimpleMatrix |
solve(SimpleMatrix B)
Computes solution Matrix ![]() ![]() |
SimpleVector |
solve(SimpleVector b)
Computes solution Vector ![]() ![]() |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DecompositionQR(SimpleMatrix A)
solve(SimpleVector b)
, solve(SimpleMatrix B)
,
getQ()
, and getR()
) can be used multiple times without having
to recompute the decomposition.
A
- The Matrix to be decomposed.Method Detail |
---|
public boolean isFullRank()
public SimpleVector solve(SimpleVector b)
Remark: If you want to further improve the accuracy of your solution in case (1),
perform a correction step in the following manner:
x = qr.solve(b);
x += qr.solve(b - A*x);
b
- The right-hand-side Vector.
solve(SimpleMatrix)
public SimpleMatrix solve(SimpleMatrix B)
solve(SimpleVector)
but for multiple
right-hand-side vectors, given as a Matrix.
B
- The right-hand-side Matrix for which a solution is computed column-wise.
solve(SimpleVector)
public SimpleMatrix getR()
public SimpleMatrix getQ()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |