Loading...
Searching...
No Matches
Foam::MatrixTools Namespace Reference

Collection of functions for matrix-related verifications. More...

Functions

template<class Form1, class Form2, class Type>
bool equal (const Matrix< Form1, Type > &A, const Matrix< Form2, Type > &B, const bool verbose=false, const label maxDiffs=10, const scalar relTol=1e-5, const scalar absTol=1e-8)
 Compare matrix elements for absolute or relative equality.
template<class Container>
OstreamprintMatrix (Ostream &os, const Container &mat)
 Simple ASCII output of Matrix, MatrixBlock.
template<class MatrixType>
MatrixType pinv (const MatrixType &A, scalar tol=1e-5)
 Moore-Penrose inverse of singular/non-singular square/rectangular scalar/complex matrices (KPP:p. 9834; KP:p. 648).

Detailed Description

Collection of functions for matrix-related verifications.

Source files

Function Documentation

◆ equal()

template<class Form1, class Form2, class Type>
bool equal ( const Matrix< Form1, Type > & A,
const Matrix< Form2, Type > & B,
const bool verbose = false,
const label maxDiffs = 10,
const scalar relTol = 1e-5,
const scalar absTol = 1e-8 )

Compare matrix elements for absolute or relative equality.

Parameters
maxDiffsStop reporting after maxDiffs (0 to disable)

Definition at line 26 of file MatrixTools.C.

References A, B, Foam::Info, Foam::mag(), and Foam::nl.

Here is the call graph for this function:

◆ printMatrix()

template<class Container>
Ostream & printMatrix ( Ostream & os,
const Container & mat )

Simple ASCII output of Matrix, MatrixBlock.

References os().

Here is the call graph for this function:

◆ pinv()

template<class MatrixType>
MatrixType pinv ( const MatrixType & A,
scalar tol = 1e-5 )

Moore-Penrose inverse of singular/non-singular square/rectangular scalar/complex matrices (KPP:p. 9834; KP:p. 648).

The tolerance to ensure the R1 matrix full-rank is set to 1e-5 by (TA; mentioned in (KPP:p. 9832)) in contrast to 1e-13 (KPP:p. 9834).

Definition at line 576 of file QRMatrix.C.

References A, Foam::abort(), QRMatrix< MatrixType >::BOTH_QR, C, Foam::diag(), e, Foam::endl(), Foam::FatalError, FatalErrorInFunction, QRMatrix< MatrixType >::FULL, Matrix< Form, Type >::m(), Foam::mag(), Matrix< Form, Type >::n(), QRMatrix< MatrixType >::P(), QRMatrix< MatrixType >::Q(), QRMatrix< MatrixType >::R(), R, Matrix< Form, Type >::resize(), QRMatrix< MatrixType >::solve(), QRMatrix< MatrixType >::TRUE, WarningInFunction, x, and Foam::Zero.

Here is the call graph for this function: