Purple::Matrix< Type > Class Template Reference

List of all members.

Public Member Functions

 Matrix ()
 Matrix (int, int)
 Matrix (int, int, const Type &)
 Matrix (int, int, const Type *)
 Matrix (const Matrix &)
Matrixoperator= (const Matrix &)
Type * operator[] (const int)
const Type * operator[] (const int) const
int getNumberOfRows () const
int getNumberOfColumns () const
 ~Matrix ()

Private Attributes

int numberOfRows
int numberOfColumns
Type ** matrix

Detailed Description

template<class Type>
class Purple::Matrix< Type >

This template class defines a matrix for general purpose use.

See also:
Vector.

Definition at line 25 of file Matrix.h.


Constructor & Destructor Documentation

template<class Type>
Purple::Matrix< Type >::Matrix (  ) 

Default constructor. It creates a matrix with zero rows and zero columns.

Definition at line 88 of file Matrix.h.

template<class Type>
Purple::Matrix< Type >::Matrix ( int  newNumberOfRows,
int  newNumberOfColumns 
)

Constructor. It creates a matrix with n rows and m columns, containing n*m copies of the default value for Type.

Parameters:
newNumberOfRows,: Number of rows in Matrix.
newNumberOfColumns,: Number of columns in Matrix.

Definition at line 101 of file Matrix.h.

template<class Type>
Purple::Matrix< Type >::Matrix ( int  newNumberOfRows,
int  newNumberOfColumns,
const Type &  type 
)

Constructor. It creates a matrix with n rows and m columns, containing n*m copies of the type value of Type.

Parameters:
newNumberOfRows,: Number of rows in Matrix.
newNumberOfColumns,: Number of columns in Matrix.
type,: Value of Type.

Definition at line 121 of file Matrix.h.

template<class Type>
Purple::Matrix< Type >::Matrix ( int  newNumberOfRows,
int  newNumberOfColumns,
const Type *  type 
)

Constructor. It creates a matrix with n rows and m columns, containing n*m copies of the type value of Type.

Parameters:
newNumberOfRows,: Number of rows in Matrix.
newNumberOfColumns,: Number of columns in Matrix.
type,: Value of Type.

Definition at line 149 of file Matrix.h.

template<class Type>
Purple::Matrix< Type >::Matrix ( const Matrix< Type > &  oldMatrix  ) 

Copy constructor. It creates a copy of an existing Matrix.

Parameters:
oldMatrix,: Matrix to be copied.

Definition at line 178 of file Matrix.h.

template<class Type>
Purple::Matrix< Type >::~Matrix (  ) 

Destructor.

Definition at line 300 of file Matrix.h.


Member Function Documentation

template<class Type>
Matrix& Purple::Matrix< Type >::operator= ( const Matrix< Type > &   ) 

template<class Type>
Type * Purple::Matrix< Type >::operator[] ( const   int  ) 

Reference operator.

Definition at line 256 of file Matrix.h.

template<class Type>
const Type * Purple::Matrix< Type >::operator[] ( const   int  )  const

Reference operator.

Definition at line 265 of file Matrix.h.

template<class Type>
int Purple::Matrix< Type >::getNumberOfRows (  )  const

This method returns the number of rows in the matrix.

Definition at line 278 of file Matrix.h.

template<class Type>
int Purple::Matrix< Type >::getNumberOfColumns (  )  const

This method returns the number of columns in the matrix.

Definition at line 289 of file Matrix.h.


Member Data Documentation

template<class Type>
int Purple::Matrix< Type >::numberOfRows [private]

Number of rows in matrix.

Definition at line 32 of file Matrix.h.

template<class Type>
int Purple::Matrix< Type >::numberOfColumns [private]

Number of columns in matrix.

Definition at line 36 of file Matrix.h.

template<class Type>
Type** Purple::Matrix< Type >::matrix [private]

Double pointer to a Type.

Definition at line 40 of file Matrix.h.


Generated on Wed Jun 21 13:10:38 2006 for Purple by  doxygen 1.4.7