A templated (m x n) matrix of objects of <T>. More...
Public Types | |
typedef Matrix< Form, Type > | mType |
Matrix type. More... | |
typedef Type | cmptType |
Component type. More... | |
Public Member Functions | |
Matrix () | |
Null constructor. More... | |
Matrix (const label m, const label n) | |
Construct given number of rows and columns. More... | |
Matrix (const label m, const label n, const zero) | |
Construct with given number of rows and columns. More... | |
Matrix (const label m, const label n, const Type &) | |
Construct with given number of rows and columns. More... | |
Matrix (const mType &) | |
Copy constructor. More... | |
template<class Form2 > | |
Matrix (const Matrix< Form2, Type > &) | |
Copy constructor from matrix of a different form. More... | |
template<class MatrixType > | |
Matrix (const ConstMatrixBlock< MatrixType > &) | |
Construct from a block of another matrix. More... | |
template<class MatrixType > | |
Matrix (const MatrixBlock< MatrixType > &) | |
Construct from a block of another matrix. More... | |
Matrix (Istream &) | |
Construct from Istream. More... | |
autoPtr< mType > | clone () const |
Clone. More... | |
~Matrix () | |
Destructor. More... | |
label | m () const |
Return the number of rows. More... | |
label | n () const |
Return the number of columns. More... | |
label | size () const |
Return the number of elements in matrix (m*n) More... | |
const Type * | v () const |
Return element vector of the constant Matrix. More... | |
Type * | v () |
Return element vector of the Matrix. More... | |
ConstMatrixBlock< mType > | block (const label m, const label n, const label mStart, const label nStart) const |
template<class VectorSpace > | |
ConstMatrixBlock< mType > | block (const label mStart, const label nStart) const |
ConstMatrixBlock< mType > | col (const label m, const label rowStart) const |
ConstMatrixBlock< mType > | col (const label m, const label mStart, const label nStart) const |
MatrixBlock< mType > | block (const label m, const label n, const label mStart, const label nStart) |
template<class VectorSpace > | |
MatrixBlock< mType > | block (const label mStart, const label nStart) |
MatrixBlock< mType > | col (const label m, const label rowStart) |
MatrixBlock< mType > | col (const label m, const label mStart, const label nStart) |
void | checki (const label i) const |
Check index i is within valid range (0 ... m-1). More... | |
void | checkj (const label j) const |
Check index j is within valid range (0 ... n-1). More... | |
void | clear () |
Clear the Matrix, i.e. set sizes to zero. More... | |
void | transfer (mType &) |
Transfer the contents of the argument Matrix into this Matrix. More... | |
void | setSize (const label m, const label n) |
Resize the matrix preserving the elements. 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... | |
const Type & | operator() (const label i, const label j) const |
(i, j) const element access operator More... | |
Type & | operator() (const label i, const label j) |
(i, j) element access operator More... | |
void | operator= (const mType &) |
Assignment operator. Takes linear time. More... | |
template<class MatrixType > | |
void | operator= (const ConstMatrixBlock< MatrixType > &) |
Assignment to a block of another matrix. More... | |
template<class MatrixType > | |
void | operator= (const MatrixBlock< MatrixType > &) |
Assignment to a block of another matrix. More... | |
void | operator= (const zero) |
Assignment of all elements to zero. More... | |
void | operator= (const Type &) |
Assignment of all elements to the given value. More... | |
template<class VectorSpace > | |
Foam::ConstMatrixBlock< Foam::Matrix< Form, Type > > | block (const label mStart, const label nStart) const |
template<class VectorSpace > | |
Foam::MatrixBlock< Foam::Matrix< Form, Type > > | block (const label mStart, const label nStart) |
Static Public Member Functions | |
static const mType & | null () |
Return a null Matrix. More... | |
Friends | |
Istream & | operator>> (Istream &, mType &) |
Read Matrix from Istream, discarding contents of existing Matrix. More... | |
Ostream & | operator (Ostream &, const mType &) |
A templated (m x n) matrix of objects of <T>.
Definition at line 47 of file DiagonalMatrix.H.
|
inline |
Null constructor.
Definition at line 31 of file MatrixI.H.
References Matrix< Form, Type >::clone().
Referenced by Matrix< Form, Type >::Matrix().
Construct given number of rows and columns.
Definition at line 43 of file Matrix.C.
References Foam::abort(), Foam::FatalError, and FatalErrorInFunction.
Construct with given number of rows and columns.
initializing all elements to zero
Definition at line 61 of file Matrix.C.
References Foam::abort(), Foam::FatalError, FatalErrorInFunction, Matrix< Form, Type >::size(), and Foam::Zero.
Construct with given number of rows and columns.
initializing all elements to the given value
Definition at line 88 of file Matrix.C.
References Foam::abort(), Foam::FatalError, FatalErrorInFunction, s(), and Matrix< Form, Type >::size().
Copy constructor.
Definition at line 115 of file Matrix.C.
References Matrix< Form, Type >::size().
Copy constructor from matrix of a different form.
Definition at line 136 of file Matrix.C.
References Matrix< Form, Type >::Matrix(), Matrix< Form, Type >::size(), and Matrix< Form, Type >::v().
|
inline |
Construct from a block of another matrix.
Definition at line 158 of file Matrix.C.
References Matrix< Form, Type >::Matrix().
|
inline |
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, FatalIOErrorInFunction, 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(), token::SPACE, and Matrix< Form, Type >::v().
|
inlinestatic |
|
inline |
Clone.
Definition at line 41 of file MatrixI.H.
Referenced by Matrix< Form, Type >::Matrix().
|
inline |
Return the number of rows.
Definition at line 57 of file MatrixI.H.
Referenced by Matrix< Form, Type >::block(), Matrix< Form, Type >::col(), QRMatrix< MatrixType >::inv(), Foam::LUBacksubstitute(), Foam::LUDecompose(), Foam::LUsolve(), Matrix< Form, Type >::Matrix(), Foam::multiply(), Foam::operator*(), Foam::operator+(), Foam::operator-(), Foam::operator/(), Foam::solve(), SVD::SVD(), and Matrix< Form, Type >::T().
|
inline |
Return the number of columns.
Definition at line 64 of file MatrixI.H.
Referenced by Matrix< Form, Type >::block(), Matrix< Form, Type >::Matrix(), Foam::multiply(), Foam::operator*(), Foam::operator+(), Foam::operator-(), Foam::operator/(), SVD::SVD(), and Matrix< Form, Type >::T().
|
inline |
Return the number of elements in matrix (m*n)
Definition at line 71 of file MatrixI.H.
Referenced by Matrix< Form, Type >::Matrix(), Foam::max(), Foam::min(), Foam::operator*(), Foam::operator+(), Foam::operator-(), Foam::operator/(), and Matrix< Form, Type >::operator=().
|
inline |
Return element vector of the constant Matrix.
Definition at line 118 of file MatrixI.H.
Referenced by Matrix< Form, Type >::Matrix(), Foam::max(), Foam::min(), Foam::operator*(), Foam::operator+(), Foam::operator-(), and Foam::operator/().
|
inline |
Return element vector of the Matrix.
Definition at line 125 of file MatrixI.H.
References Matrix< Form, Type >::block().
|
inline |
Definition at line 134 of file MatrixI.H.
References Matrix< Form, Type >::m(), and Matrix< Form, Type >::n().
Referenced by Matrix< Form, Type >::col(), QRMatrix< MatrixType >::inv(), and Matrix< Form, Type >::v().
|
inline |
|
inline |
Definition at line 175 of file MatrixI.H.
References Matrix< Form, Type >::m().
Referenced by Matrix< Form, Type >::block(), and Matrix< Form, Type >::col().
|
inline |
Definition at line 194 of file MatrixI.H.
References Matrix< Form, Type >::block(), and Matrix< Form, Type >::m().
|
inline |
Definition at line 214 of file MatrixI.H.
References Matrix< Form, Type >::m(), and Matrix< Form, Type >::n().
|
inline |
|
inline |
Definition at line 250 of file MatrixI.H.
References Matrix< Form, Type >::col(), and Matrix< Form, Type >::m().
|
inline |
Definition at line 266 of file MatrixI.H.
References Matrix< Form, Type >::m(), and Matrix< Form, Type >::operator.
|
inline |
Check index i is within valid range (0 ... m-1).
Definition at line 78 of file MatrixI.H.
References Foam::abort(), Foam::FatalError, and FatalErrorInFunction.
Referenced by Matrix< Form, Type >::operator()(), and Matrix< Form, Type >::operator[]().
|
inline |
Check index j is within valid range (0 ... n-1).
Definition at line 98 of file MatrixI.H.
References Foam::abort(), Foam::FatalError, and FatalErrorInFunction.
Referenced by Matrix< Form, Type >::operator()().
void clear | ( | ) |
Clear the Matrix, i.e. set sizes to zero.
Definition at line 214 of file Matrix.C.
Referenced by Matrix< Form, Type >::Matrix(), Matrix< Form, Type >::operator=(), and Matrix< Form, Type >::transfer().
void transfer | ( | mType & | M | ) |
Transfer the contents of the argument Matrix into this Matrix.
and annul the argument Matrix.
Definition at line 228 of file Matrix.C.
References Matrix< Form, Type >::clear().
Referenced by Matrix< Form, Type >::setSize().
Resize the matrix preserving the elements.
Definition at line 244 of file Matrix.C.
References Foam::min(), Matrix< Form, Type >::transfer(), and Foam::Zero.
Form T | ( | ) | const |
Return the transpose of the matrix.
Definition at line 264 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 320 of file MatrixI.H.
References Matrix< Form, Type >::checki().
Return subscript-checked row of constant Matrix.
Definition at line 312 of file MatrixI.H.
References Matrix< Form, Type >::checki().
(i, j) const element access operator
Definition at line 287 of file MatrixI.H.
References Matrix< Form, Type >::checki(), Matrix< Form, Type >::checkj(), and Matrix< Form, Type >::operator.
(i, j) element access operator
Definition at line 300 of file MatrixI.H.
References Matrix< Form, Type >::checki(), and Matrix< Form, Type >::checkj().
Assignment operator. Takes linear time.
Definition at line 284 of file Matrix.C.
References Foam::abort(), Matrix< Form, Type >::clear(), Foam::FatalError, FatalErrorInFunction, and Matrix< Form, Type >::size().
void operator= | ( | const ConstMatrixBlock< MatrixType > & | Mb | ) |
void operator= | ( | const MatrixBlock< MatrixType > & | Mb | ) |
Assignment of all elements to zero.
Definition at line 361 of file Matrix.C.
References Matrix< Form, Type >::size(), and Foam::Zero.
void operator= | ( | const Type & | s | ) |
Assignment of all elements to the given value.
Definition at line 347 of file Matrix.C.
References s(), and Matrix< Form, Type >::size().
|
inline |
Definition at line 156 of file MatrixI.H.
References Matrix< Form, Type >::col(), VectorSpace< Form, Cmpt, Ncmpts >::mRows, and VectorSpace< Form, Cmpt, Ncmpts >::nCols.
|
inline |
Definition at line 235 of file MatrixI.H.
References VectorSpace< Form, Cmpt, Ncmpts >::mRows, and VectorSpace< Form, Cmpt, Ncmpts >::nCols.
Read Matrix from Istream, discarding contents of existing Matrix.
Referenced by Matrix< Form, Type >::Matrix().
Referenced by Matrix< Form, Type >::col(), and Matrix< Form, Type >::operator()().