A templated 2D matrix of objects of <T>, where the n x m matrix dimensions are known and used for subscript bounds checking, etc. More...
#include <OpenFOAM/Matrix.H>
A templated 2D matrix of objects of <T>, where the n x m matrix dimensions are known and used for subscript bounds checking, etc.
Definition at line 74 of file Matrix.H.
Inheritance diagram for Matrix< Form, Type >:
Collaboration diagram for Matrix< Form, Type >:Public Member Functions | |
| Matrix () | |
| Null constructor.
| |
| Matrix (const label n, const label m) | |
| Construct given number of rows and columns.
| |
| Matrix (const label n, const label m, const Type &) | |
| Construct with given number of rows and columns.
| |
| Matrix (const Matrix< Form, Type > &) | |
| Copy constructor.
| |
| Matrix (Istream &) | |
| Construct from Istream.
| |
| autoPtr< Matrix< Form, Type > > | clone () const |
| Clone.
| |
| ~Matrix () | |
| label | n () const |
| Return the number of rows.
| |
| label | m () const |
| Return the number of columns.
| |
| label | size () const |
| Return the number of elements in matrix (n*m)
| |
| void | checki (const label i) const |
| Check index i is within valid range (0 ... n-1).
| |
| void | checkj (const label j) const |
| Check index j is within valid range (0 ... m-1).
| |
| void | clear () |
| Clear the Matrix, i.e. set sizes to zero.
| |
| void | transfer (Matrix< Form, Type > &) |
| Transfer the contents of the argument Matrix into this Matrix.
| |
| Form | T () const |
| Return the transpose of the matrix.
| |
| Type * | operator[] (const label) |
| Return subscript-checked row of Matrix.
| |
| const Type * | operator[] (const label) const |
| Return subscript-checked row of constant Matrix.
| |
| void | operator= (const Matrix< Form, Type > &) |
| Assignment operator. Takes linear time.
| |
| void | operator= (const Type &) |
| Assignment of all entries to the given value.
| |
Static Public Member Functions | |
| static const Matrix< Form, Type > & | null () |
| Return a null Matrix.
| |
Friends | |
| Istream & | operator>> (Istream &, Matrix< Form, Type > &) |
| Read Matrix from Istream, discarding contents of existing Matrix.
| |
| Ostream & | operator (Ostream &, const Matrix< Form, Type > &) |
| Matrix | ( | const label | n, |
| const label | m | ||
| ) |
Construct given number of rows and columns.
Definition at line 62 of file Matrix.C.
References Foam::abort(), Foam::FatalError, and FatalErrorIn.
| Matrix | ( | const label | n, |
| const label | m, | ||
| const Type & | a | ||
| ) |
Construct with given number of rows and columns.
and value for all elements.
Definition at line 80 of file Matrix.C.
References Foam::abort(), Foam::FatalError, and FatalErrorIn.
Construct from Istream.
Definition at line 35 of file MatrixIO.C.
References Matrix< Form, Type >::operator>>.
| const Foam::Matrix< Form, Type > & null | ( | ) | [inline, static]
|
| Foam::autoPtr< Foam::Matrix< Form, Type > > clone | ( | ) | const [inline]
|
Clone.
Reimplemented in RectangularMatrix< Type >, SquareMatrix< Type >, RectangularMatrix< scalar >, and SquareMatrix< scalar >.
| Foam::label n | ( | ) | const [inline]
|
Return the number of rows.
Definition at line 55 of file MatrixI.H.
Referenced by Foam::LUBacksubstitute(), Foam::LUDecompose(), Foam::LUsolve(), Foam::max(), Foam::min(), Foam::multiply(), Foam::operator*(), Foam::operator+(), Foam::operator-(), Foam::operator>>(), Foam::solve(), and SVD::SVD().
| Foam::label m | ( | ) | const [inline]
|
Return the number of columns.
Definition at line 62 of file MatrixI.H.
Referenced by Foam::max(), Foam::min(), Foam::multiply(), Foam::operator*(), Foam::operator+(), Foam::operator-(), Foam::operator>>(), and SVD::SVD().
| Foam::label size | ( | ) | const [inline]
|
| void checki | ( | const label | i ) | const [inline]
|
Check index i is within valid range (0 ... n-1).
Definition at line 76 of file MatrixI.H.
References Foam::abort(), Foam::FatalError, and FatalErrorIn.
| void checkj | ( | const label | j ) | const [inline]
|
Check index j is within valid range (0 ... m-1).
Definition at line 94 of file MatrixI.H.
References Foam::abort(), Foam::FatalError, and FatalErrorIn.
| void clear | ( | ) |
Clear the Matrix, i.e. set sizes to zero.
Definition at line 134 of file Matrix.C.
Referenced by Foam::operator>>().
| void transfer | ( | Matrix< Form, Type > & | a ) |
| Form T | ( | ) | const |
Return the transpose of the matrix.
Definition at line 164 of file Matrix.C.
References A.
Referenced by SVD::SVD().
| Type * operator[] | ( | const label | i ) | [inline]
|
| const Type * operator[] | ( | const label | i ) | const [inline]
|
| void operator= | ( | const Matrix< Form, Type > & | a ) |
Assignment operator. Takes linear time.
Definition at line 201 of file Matrix.C.
References Foam::abort(), clear(), Foam::FatalError, and FatalErrorIn.
| void operator= | ( | const Type & | t ) |
Read Matrix from Istream, discarding contents of existing Matrix.
Referenced by Matrix< Form, Type >::Matrix().