Hosting courtesy of Sourceforge

SourceForge Logo
Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

Util::Matrix Class Template Reference

#include <Matrix.h>

Inheritance diagram for Util::Matrix:

Inheritance graph
[legend]
List of all members.

Public Methods

 Matrix (int rows, int cols)
 Matrix (int rows, int cols, const element &defElement)
element & operator() (int row, int col)
int numRows () const
int numCols () const

Detailed Description

template<class element>
class Util::Matrix< element >

Generic (minimalist as of now) Matrix class

Definition at line 31 of file Matrix.h.


Constructor & Destructor Documentation

template<class element>
Util::Matrix< element >::Matrix int    rows,
int    cols
 

Create a matrix filled rows*cols elements, each with the value given by the default constructor

Definition at line 90 of file Matrix.h.

template<class element>
Util::Matrix< element >::Matrix int    numRows,
int    numCols,
const element &    defElement
 

Create matrix filled with rows*cols elements, each with value given by defElement

Definition at line 74 of file Matrix.h.

template<class element>
Util::Matrix< element >::~Matrix  
 

Definition at line 94 of file Matrix.h.


Member Function Documentation

template<class element>
int Util::Matrix< element >::numCols   const
 

Returns the number of columns in matrix. Accessing element at column numColss() results in off by 1 error

Definition at line 58 of file Matrix.h.

template<class element>
int Util::Matrix< element >::numRows   const
 

Returns the number of rows in matrix. Accessing element at row numRows() results in off by 1 error

Definition at line 54 of file Matrix.h.

template<class element>
const element& Util::Matrix< element >::operator() int    row,
int    col
const
 

Definition at line 50 of file Matrix.h.

template<class element>
element& Util::Matrix< element >::operator() int    row,
int    col
 

Gives access to elements in Matrix, uses 0 based indexing

NOTE: access like this.
Matrix<int> mat(2,2, -111);
i = mat(2,1); // assigns i to value at the 3rd row and 2nd column

Parameters:
row  row to be accessed
col  column to be accessed

Definition at line 49 of file Matrix.h.


Member Data Documentation

template<class element>
int Util::Matrix::cols [protected]
 

Definition at line 61 of file Matrix.h.

template<class element>
element* Util::Matrix::elemList [protected]
 

Definition at line 62 of file Matrix.h.

template<class element>
int Util::Matrix::rows [protected]
 

Definition at line 60 of file Matrix.h.


The documentation for this class was generated from the following file:
Generated on Tue May 21 07:26:58 2002 for BomberLAN by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001