Public Types | Public Member Functions | List of all members
QRMatrix< MatrixType > Class Template Reference

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< cmptTypeQMatrixType
 
typedef MatrixType RMatrixType
 

Public Member Functions

 QRMatrix ()
 Construct null. More...
 
 QRMatrix (const MatrixType &M)
 Construct decomposing given matrix. More...
 
const QMatrixTypeQ () const
 Return Q-matrix. More...
 
const RMatrixTypeR () 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...
 

Detailed Description

template<class MatrixType>
class Foam::QRMatrix< MatrixType >

Class templated on matrix type to perform the QR decomposition using Householder reflections on a square or rectangular matrix.

Source files

Definition at line 51 of file QRMatrix.H.

Member Typedef Documentation

typedef MatrixType::cmptType cmptType

Definition at line 56 of file QRMatrix.H.

Definition at line 57 of file QRMatrix.H.

typedef MatrixType RMatrixType

Definition at line 58 of file QRMatrix.H.

Constructor & Destructor Documentation

QRMatrix ( )
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.

Member Function Documentation

const Foam::QRMatrix< MatrixType >::QMatrixType & Q ( ) const
inline

Return Q-matrix.

Definition at line 37 of file QRMatrixI.H.

const Foam::QRMatrix< MatrixType >::RMatrixType & R ( ) const
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(), Foam::constant::atomic::alpha, Foam::FatalError, FatalErrorInFunction, Foam::I, k, M, Foam::mag(), n, QRMatrix< MatrixType >::solve(), Foam::sqr(), Foam::sqrt(), Foam::sum(), x, and Foam::Zero.

Here is the call graph for this function:

void solve ( Field< cmptType > &  x,
const Field< cmptType > &  source 
) const

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().

Here is the caller graph for this function:

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().

Here is the call graph for this function:

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.

Here is the call graph for this function:


The documentation for this class was generated from the following files: