OpenFOAM logo
The Open Source CFD Toolbox
  Programmer’s C++ Doxygen OpenCFD Solutions Contact OpenFOAM

Matrix Class Template Reference

Inheritance diagram for Matrix:

Inheritance graph
[legend]
Collaboration diagram for Matrix:

Collaboration graph
[legend]
List of all members.

Detailed Description

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

Definition at line 80 of file Matrix.H.


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

static 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 > &)
Istream & operator>> (Istream &, Matrix< T > &)
 Read Matrix from Istream, discarding contents of existing Matrix.
Ostream & operator (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

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

Clone.

Definition at line 51 of file MatrixI.H.

static Matrix<T>& null (  )  [static]

Return a null Matrix.

label n (  )  const [inline]

Return the number of rows.

Definition at line 61 of file MatrixI.H.

label m (  )  const [inline]

Return the number of columns.

Definition at line 69 of file MatrixI.H.

label size (  )  const [inline]

Return the number of columns.

Definition at line 77 of file MatrixI.H.

References FatalErrorIn.

void checki ( const label  i  )  const [inline]

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

Definition at line 85 of file MatrixI.H.

void checkj ( const label  j  )  const [inline]

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

Definition at line 104 of file MatrixI.H.

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.

and annull the argument Matrix.

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

Return subscript-checked element of Matrix.

Definition at line 125 of file MatrixI.H.

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

Return subscript-checked element of constant Matrix.

Definition at line 136 of file MatrixI.H.

void operator= ( const Matrix< T > &   ) 

Assignment operator. Takes linear time.

void operator= ( const T &   ) 

Assignment of all entries to the given value.


Friends And Related Function Documentation

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

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

Matrix<T> operator- ( 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   scalar,
const Matrix< T > &   
) [friend]

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

Read Matrix from Istream, discarding contents of existing Matrix.

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


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