Class templated on matrix type to perform the QR decomposition using Householder reflections on a square or rectangular matrix. More...
Public Types | |
typedef MatrixType::cmptType | cmptType |
typedef SquareMatrix< cmptType > | QMatrixType |
typedef MatrixType | RMatrixType |
Public Member Functions | |
QRMatrix () | |
Construct null. More... | |
QRMatrix (const MatrixType &M) | |
Construct decomposing given matrix. More... | |
const QMatrixType & | Q () const |
Return Q-matrix. More... | |
const RMatrixType & | R () const |
Return R-matrix. More... | |
void | decompose (const MatrixType &M) |
Decompose given matrix. More... | |
void | solve (Field< cmptType > &x, const Field< cmptType > &source) const |
Solve the linear system with the given source. More... | |
tmp< Field< cmptType > > | solve (const Field< cmptType > &source) const |
Solve the linear system with the given source. More... | |
QMatrixType | inv () const |
Return the inverse of a square matrix. More... | |
Class templated on matrix type to perform the QR decomposition using Householder reflections on a square or rectangular matrix.
Definition at line 51 of file QRMatrix.H.
typedef MatrixType::cmptType cmptType |
Definition at line 56 of file QRMatrix.H.
typedef SquareMatrix<cmptType> QMatrixType |
Definition at line 57 of file QRMatrix.H.
typedef MatrixType RMatrixType |
Definition at line 58 of file QRMatrix.H.
|
inline |
Construct null.
Definition at line 29 of file QRMatrixI.H.
QRMatrix | ( | const MatrixType & | M | ) |
Construct decomposing given matrix.
Definition at line 31 of file QRMatrix.C.
|
inline |
Return Q-matrix.
Definition at line 37 of file QRMatrixI.H.
|
inline |
Return R-matrix.
Definition at line 45 of file QRMatrixI.H.
void decompose | ( | const MatrixType & | M | ) |
Decompose given matrix.
Definition at line 40 of file QRMatrix.C.
References Foam::abort(), alpha(), Foam::FatalError, FatalErrorInFunction, Foam::I, k, M, Foam::mag(), n, QRMatrix< MatrixType >::solve(), Foam::sqr(), Foam::sqrt(), Foam::sum(), x, and Foam::Zero.
Solve the linear system with the given source.
and returning the solution in the Field argument x
Definition at line 189 of file QRMatrix.C.
Referenced by QRMatrix< MatrixType >::decompose().
Foam::tmp< Foam::Field< typename MatrixType::cmptType > > solve | ( | const Field< cmptType > & | source | ) | const |
Solve the linear system with the given source.
returning the solution
Definition at line 213 of file QRMatrix.C.
References tmp< T >::ref(), and solve().
Foam::QRMatrix< MatrixType >::QMatrixType inv | ( | ) | const |
Return the inverse of a square matrix.
Definition at line 228 of file QRMatrix.C.
References Matrix< Form, Type >::block(), Foam::inv(), Matrix< Form, Type >::m(), and x.