OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

Matrix< Form, Type > Class Template Reference

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...

Inheritance diagram for Matrix< Form, Type >:
Collaboration diagram for Matrix< Form, Type >:

List of all members.


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 element of Matrix.
const Type * operator[] (const label) const
 Return subscript-checked element 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 > &)

Detailed Description

template<class Form, class Type>
class Foam::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.

Source files

Definition at line 69 of file Matrix.H.


Constructor & Destructor Documentation

Matrix (  )  [inline]

Null constructor.

Definition at line 21 of file MatrixI.H.

Matrix ( const label  n,
const label  m 
) [inline]

Construct given number of rows and columns.

Definition at line 54 of file Matrix.C.

Matrix ( const label  n,
const label  m,
const Type &  a 
) [inline]

Construct with given number of rows and columns.

and value for all elements.

Definition at line 72 of file Matrix.C.

Matrix ( const Matrix< Form, Type > &  a  )  [inline]

Copy constructor.

Definition at line 104 of file Matrix.C.

Matrix ( Istream &  is  )  [inline]

Construct from Istream.

Definition at line 27 of file MatrixIO.C.

~Matrix (  )  [inline]

Definition at line 41 of file Matrix.C.


Member Function Documentation

const Foam::Matrix< Form, Type > & null (  )  [inline, static]

Return a null Matrix.

Definition at line 39 of file MatrixI.H.

Foam::autoPtr< Foam::Matrix< Form, Type > > clone (  )  const [inline]

Foam::label n (  )  const [inline]

Return the number of rows.

Definition at line 47 of file MatrixI.H.

Referenced by Foam::LUDecompose(), Foam::solve(), and SVD::SVD().

Here is the caller graph for this function:

Foam::label m (  )  const [inline]

Return the number of columns.

Definition at line 54 of file MatrixI.H.

Referenced by SVD::SVD().

Here is the caller graph for this function:

Foam::label size (  )  const [inline]

Return the number of elements in matrix (n*m).

Definition at line 61 of file MatrixI.H.

void checki ( const label  i  )  const [inline]

Check index i is within valid range (0 ... n-1).

Definition at line 68 of file MatrixI.H.

Referenced by Matrix< Form, Type >::operator[]().

Here is the caller graph for this function:

void checkj ( const label  j  )  const [inline]

Check index j is within valid range (0 ... m-1).

Definition at line 86 of file MatrixI.H.

References Foam::abort(), Foam::FatalError, and FatalErrorIn.

Here is the call graph for this function:

void clear (  )  [inline]

Clear the Matrix, i.e. set sizes to zero.

Definition at line 126 of file Matrix.C.

void transfer ( Matrix< Form, Type > &  a  )  [inline]

Transfer the contents of the argument Matrix into this Matrix.

and annull the argument Matrix.

Definition at line 140 of file Matrix.C.

Form T (  )  const [inline]

Return the transpose of the matrix.

Definition at line 156 of file Matrix.C.

Referenced by SVD::SVD().

Here is the caller graph for this function:

Type * operator[] ( const label  i  )  [inline]

Return subscript-checked element of Matrix.

Definition at line 106 of file MatrixI.H.

const Type * operator[] ( const label  i  )  const [inline]

Return subscript-checked element of constant Matrix.

Definition at line 116 of file MatrixI.H.

References Matrix< Form, Type >::checki().

Here is the call graph for this function:

void operator= ( const Matrix< Form, Type > &  a  )  [inline]

Assignment operator. Takes linear time.

Definition at line 193 of file Matrix.C.

void operator= ( const Type &  t  )  [inline]

Assignment of all entries to the given value.

Definition at line 176 of file Matrix.C.


Friends And Related Function Documentation

Istream& operator>> ( Istream &  ,
Matrix< Form, Type > &   
) [friend]

Read Matrix from Istream, discarding contents of existing Matrix.

Ostream& operator ( Ostream &  ,
const Matrix< Form, Type > &   
) [friend]


The documentation for this class was generated from the following files:
Copyright © 2000-2009 OpenCFD Ltd