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...
Public Member Functions | |
Matrix () | |
Null constructor. More... | |
Matrix (const label n, const label m) | |
Construct given number of rows and columns. More... | |
Matrix (const label n, const label m, const Type &) | |
Construct with given number of rows and columns. More... | |
Matrix (const Matrix< Form, Type > &) | |
Copy constructor. More... | |
Matrix (Istream &) | |
Construct from Istream. More... | |
autoPtr< Matrix< Form, Type > > | clone () const |
Clone. More... | |
~Matrix () | |
Destructor. More... | |
label | n () const |
Return the number of rows. More... | |
label | m () const |
Return the number of columns. More... | |
label | size () const |
Return the number of elements in matrix (n*m) More... | |
void | checki (const label i) const |
Check index i is within valid range (0 ... n-1). More... | |
void | checkj (const label j) const |
Check index j is within valid range (0 ... m-1). More... | |
void | clear () |
Clear the Matrix, i.e. set sizes to zero. More... | |
void | transfer (Matrix< Form, Type > &) |
Transfer the contents of the argument Matrix into this Matrix. More... | |
Form | T () const |
Return the transpose of the matrix. More... | |
Type * | operator[] (const label) |
Return subscript-checked row of Matrix. More... | |
const Type * | operator[] (const label) const |
Return subscript-checked row of constant Matrix. More... | |
void | operator= (const Matrix< Form, Type > &) |
Assignment operator. Takes linear time. More... | |
void | operator= (const Type &) |
Assignment of all entries to the given value. More... | |
Static Public Member Functions | |
static const Matrix< Form, Type > & | null () |
Return a null Matrix. More... | |
Friends | |
Istream & | operator>> (Istream &, Matrix< Form, Type > &) |
Read Matrix from Istream, discarding contents of existing Matrix. More... | |
Ostream & | operator (Ostream &, const Matrix< Form, Type > &) |
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 47 of file DiagonalMatrix.H.
|
inline |
Null constructor.
Definition at line 29 of file MatrixI.H.
References Matrix< Form, Type >::clone().
Construct given number of rows and columns.
Definition at line 62 of file Matrix.C.
References Foam::abort(), Foam::FatalError, and FatalErrorIn.
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 IOstream::ASCII, token::BEGIN_BLOCK, token::BEGIN_LIST, Matrix< Form, Type >::clear(), token::END_BLOCK, token::END_LIST, Foam::exit(), IOstream::fatalCheck(), Foam::FatalIOError, FatalIOErrorIn, IOstream::format(), token::info(), token::isLabel(), k, token::labelToken(), Matrix< Form, Type >::m(), M, Matrix< Form, Type >::n(), Foam::nl, Foam::operator>>(), Matrix< Form, Type >::operator>>, Istream::read(), Istream::readBeginList(), Istream::readEndList(), Foam::readLabel(), and token::SPACE.
|
inlinestatic |
|
inline |
Clone.
Definition at line 39 of file MatrixI.H.
Referenced by Matrix< Form, Type >::Matrix().
|
inline |
Return the number of rows.
Definition at line 56 of file MatrixI.H.
Referenced by Foam::LUBacksubstitute(), Foam::LUDecompose(), Foam::LUsolve(), Matrix< Form, Type >::Matrix(), Foam::max(), Foam::min(), Foam::multiply(), Foam::operator*(), Foam::operator+(), Foam::operator-(), Foam::solve(), SVD::SVD(), and Matrix< Form, Type >::T().
|
inline |
Return the number of columns.
Definition at line 63 of file MatrixI.H.
Referenced by Matrix< Form, Type >::Matrix(), Foam::max(), Foam::min(), Foam::multiply(), Foam::operator*(), Foam::operator+(), Foam::operator-(), SVD::SVD(), and Matrix< Form, Type >::T().
|
inline |
|
inline |
Check index i is within valid range (0 ... n-1).
Definition at line 77 of file MatrixI.H.
References Foam::abort(), Foam::FatalError, and FatalErrorIn.
Referenced by Matrix< Form, Type >::operator[]().
|
inline |
Check index j is within valid range (0 ... m-1).
Definition at line 95 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 Matrix< Form, Type >::Matrix(), Matrix< Form, Type >::operator=(), and Matrix< Form, Type >::transfer().
void transfer | ( | Matrix< Form, Type > & | a | ) |
Form T | ( | ) | const |
Return the transpose of the matrix.
Definition at line 164 of file Matrix.C.
References Matrix< Form, Type >::m(), and Matrix< Form, Type >::n().
Referenced by SVD::SVD().
Return subscript-checked row of Matrix.
Definition at line 115 of file MatrixI.H.
References Matrix< Form, Type >::checki().
Return subscript-checked row of constant Matrix.
Definition at line 125 of file MatrixI.H.
References Matrix< Form, Type >::checki().
Assignment operator. Takes linear time.
Definition at line 201 of file Matrix.C.
References Foam::abort(), Matrix< Form, Type >::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().