OpenFOAM logo
Open Source CFD Toolkit

Matrix Class Template Reference

Inheritance diagram for Matrix:

Inheritance graph
[legend]
Collaboration diagram for Matrix:

Collaboration graph
[legend]
List of all members.

template<class T>
class Foam::Matrix< T >


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 T &)
 Construct with given number of rows and columns.
 Matrix (const Matrix< T > &)
 Copy constructor.
 Matrix (Istream &)
 Construct from Istream.
autoPtr< Matrix< T > > 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 columns.
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< T > &)
 Transfer the contents of the argument Matrix into this Matrix.
T * operator[] (const label)
 Return subscript-checked element of Matrix.
const T * operator[] (const label) const
 Return subscript-checked element of constant Matrix.
void operator= (const Matrix< T > &)
 Assignment operator. Takes linear time.
void operator= (const T &)
 Assignment of all entries to the given value.

Static Public Member Functions

Matrix< T > & null ()
 Return a null Matrix.

Friends

const T & max (const Matrix< T > &)
const T & min (const Matrix< T > &)
Matrix< T > operator- (const Matrix< T > &)
Matrix< T > operator+ (const Matrix< T > &, const Matrix< T > &)
Matrix< T > operator- (const Matrix< T > &, const Matrix< T > &)
Matrix< T > operator * (const scalar, const Matrix< T > &)
Istreamoperator>> (Istream &, Matrix< T > &)
 Read Matrix from Istream, discarding contents of existing Matrix.
Ostreamoperator (Ostream &, const Matrix< T > &)

Constructor & Destructor Documentation

Matrix  )  [inline]
 

Null constructor.

Definition at line 42 of file MatrixI.H.

Matrix const label  n,
const label  m
 

Construct given number of rows and columns.

Matrix const label  n,
const label  m,
const T & 
 

Construct with given number of rows and columns.

and value for all elements.

Matrix const Matrix< T > &   ) 
 

Copy constructor.

Matrix Istream  ) 
 

Construct from Istream.

~Matrix  ) 
 


Member Function Documentation

void checki const label  i  )  const [inline]
 

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

Definition at line 84 of file MatrixI.H.

void checkj const label  j  )  const [inline]
 

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

Definition at line 103 of file MatrixI.H.

void clear  ) 
 

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

autoPtr< Matrix< T > > clone  )  const [inline]
 

Clone.

Definition at line 51 of file MatrixI.H.

References Foam::label.

label m  )  const [inline]
 

Return the number of columns.

Definition at line 68 of file MatrixI.H.

References Foam::label.

label n  )  const [inline]
 

Return the number of rows.

Definition at line 60 of file MatrixI.H.

References Foam::label.

Matrix<T>& null  )  [static]
 

Return a null Matrix.

void operator= const T &   ) 
 

Assignment of all entries to the given value.

void operator= const Matrix< T > &   ) 
 

Assignment operator. Takes linear time.

const T * operator[] const   label  )  const [inline]
 

Return subscript-checked element of constant Matrix.

Definition at line 135 of file MatrixI.H.

T * operator[] const   label  )  [inline]
 

Return subscript-checked element of Matrix.

Definition at line 124 of file MatrixI.H.

label size  )  const [inline]
 

Return the number of columns.

Definition at line 76 of file MatrixI.H.

References FatalErrorIn.

void transfer Matrix< T > &   ) 
 

Transfer the contents of the argument Matrix into this Matrix.

and annull the argument Matrix.


Friends And Related Function Documentation

const T& max const Matrix< T > &   )  [friend]
 

const T& min const Matrix< T > &   )  [friend]
 

Ostream& operator Ostream ,
const Matrix< T > & 
[friend]
 

Matrix<T> operator * const   scalar,
const Matrix< T > & 
[friend]
 

Matrix<T> operator+ const Matrix< T > &  ,
const Matrix< T > & 
[friend]
 

Matrix<T> operator- const Matrix< T > &  ,
const Matrix< T > & 
[friend]
 

Matrix<T> operator- const Matrix< T > &   )  [friend]
 

Istream& operator>> Istream ,
Matrix< T > & 
[friend]
 

Read Matrix from Istream, discarding contents of existing Matrix.


The documentation for this class was generated from the following files:
For further information go to www.openfoam.org