OpenMD 3.1
Molecular Dynamics in the Open
|
#include <QR.hpp>
Public Member Functions | |
for (k=0;k< n;k++) | |
int | isFullRank () const |
Flag to denote the matrix is of full rank. | |
DynamicRectMatrix< Real > | getHouseholder (void) const |
Retreive the Householder vectors from QR factorization. | |
DynamicRectMatrix< Real > | getR () const |
Return the upper triangular factor, R, of the QR factorization. | |
DynamicRectMatrix< Real > | getQ () const |
Generate and return the (economy-sized) orthogonal factor. | |
DynamicVector< Real > | solve (const DynamicVector< Real > &b) const |
Least squares solution of A*x = b. | |
DynamicRectMatrix< Real > | solve (const DynamicRectMatrix< Real > &B) const |
Least squares solution of A*X = B. | |
Public Attributes | |
m = A.getNRow() | |
Create a QR factorization object for A. | |
n = A.getNCol() | |
Rdiag = DynamicVector<Real>(n) | |
int | i = 0 |
int | j = 0 |
int | k = 0 |
Classical QR Decompisition: for an m-by-n matrix A with m >= n, the QR decomposition is an m-by-n orthogonal matrix Q and an n-by-n upper triangular matrix R so that A = Q*R.
The QR decompostion always exists, even if the matrix does not have full rank, so the constructor will never fail. The primary use of the QR decomposition is in the least squares solution of nonsquare systems of simultaneous linear equations. This will fail if isFullRank() returns 0 (false).
The Q and R factors can be retrived via the getQ() and getR() methods. Furthermore, a solve() method is provided to find the least squares solution of Ax=b using the QR factors.
(Adapted from JAMA, a Java Matrix Library, developed by jointly by the Mathworks and NIST; see http://math.nist.gov/javanumerics/jama).
|
inline |
|
inline |
|
inline |
|
inline |
Flag to denote the matrix is of full rank.
Definition at line 106 of file QR.hpp.
Referenced by JAMA::QR< Real >::solve(), and JAMA::QR< Real >::solve().
|
inline |
Least squares solution of A*X = B.
B | m x k Array (must conform). |
Definition at line 234 of file QR.hpp.
References JAMA::QR< Real >::isFullRank().
|
inline |
Least squares solution of A*x = b.
b | m-length array (vector). |
Definition at line 190 of file QR.hpp.
References JAMA::QR< Real >::isFullRank().
JAMA::QR< Real >::m = A.getNRow() |
JAMA::QR< Real >::Rdiag = DynamicVector<Real>(n) |