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. More...
 
template<class Container >
OstreamprintMatrix (Ostream &os, const Container &mat)
 Simple ASCII output of Matrix, MatrixBlock. More...
 
template<class MatrixType >
MatrixType pinv (const MatrixType &A, scalar tol=1e-5)
 

Detailed Description

Collection of functions for matrix-related verifications.

Source files

Function Documentation

◆ equal()

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 33 of file MatrixTools.C.

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

Here is the call graph for this function:

◆ printMatrix()

Ostream & printMatrix ( Ostream os,
const Container &  mat 
)

Simple ASCII output of Matrix, MatrixBlock.

◆ pinv()

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

References A, Foam::abort(), Foam::diag(), e, Foam::endl(), Foam::FatalError, FatalErrorInFunction, Foam::lessThan(), 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(), WarningInFunction, x, and Foam::Zero.

Here is the call graph for this function: