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

◆ cmptType

typedef MatrixType::cmptType cmptType

Definition at line 56 of file QRMatrix.H.

◆ QMatrixType

Definition at line 57 of file QRMatrix.H.

◆ RMatrixType

typedef MatrixType RMatrixType

Definition at line 58 of file QRMatrix.H.

Constructor & Destructor Documentation

◆ QRMatrix() [1/2]

QRMatrix
inline

Construct null.

Definition at line 29 of file QRMatrixI.H.

◆ QRMatrix() [2/2]

QRMatrix ( const MatrixType &  M)

Construct decomposing given matrix.

Definition at line 31 of file QRMatrix.C.

References M.

Member Function Documentation

◆ Q()

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

Return Q-matrix.

Definition at line 37 of file QRMatrixI.H.

◆ R()

const Foam::QRMatrix< MatrixType >::RMatrixType & R
inline

Return R-matrix.

Definition at line 45 of file QRMatrixI.H.

◆ decompose()

void decompose ( const MatrixType &  M)

Decompose given matrix.

Definition at line 40 of file QRMatrix.C.

References alpha(), Foam::I, k, M, n, Foam::sqr(), Foam::sqrt(), and Foam::Zero.

Here is the call graph for this function:

◆ solve() [1/2]

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 188 of file QRMatrix.C.

References x.

◆ solve() [2/2]

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 212 of file QRMatrix.C.

References tmp< T >::ref(), solve(), and x.

Here is the call graph for this function:

◆ inv()

Foam::QRMatrix< MatrixType >::QMatrixType inv

Return the inverse of a square matrix.

Definition at line 228 of file QRMatrix.C.

References 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: