Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

CMatrix Class Template Reference

A Two dimensional matrix class. More...

Inheritance diagram for CMatrix::

GreyImage List of all members.

Public Methods

 CMatrix ()
 CMatrix (int x, int y)
virtual ~CMatrix ()
int xmax ()
 Maximum defined x value (1 greater than the farthest element to the right). More...

int ymax ()
 Maximum defined y value (1 greater than the farthest element at the bottom). More...

int xmin ()
 Minimum defined x value (farthest left element). More...

int ymin ()
 Minimum defined y value (closest to top element). More...

int size ()
 Total number of elements in the matrix. More...

int x ()
 Total width of image. More...

int y ()
 Total height of image. More...

T & operator() (const unsigned int x, const unsigned int y)
 Access an individual element using this. More...

CMatrix< T > & operator= (CMatrix< T > &RHS)
 Used to copy one matrix to another using the assignment operator. More...

double interpolate (double x, double y)
 Performs bilinear interpolation (given the four nearest neighbors). More...

T & operator[] (const unsigned int val)
 Useful if you consider the matrix to be single dimensional by lining up the rows. More...

void Initialize (T val)
 Stores 'val' at all locations in the matrix. More...

void SetRange (int xtop, int ytop, int xbottom, int ybottom, bool copy=true)
void SetRange (CMatrix< T > OLD, bool copy=true)
 Set the range based upon another matrix. More...

void SetSize (int x, int y)
 This sets the minimum CMatrix coordinates to (0,0), and the max to x, y. More...


Public Attributes

T * m_CMatrix
 The actual data that stores the matrix. Don't ruin the pointers. Generally, don't mess with this unless you really, really need to be clever. More...

T * zeroloc
 The actual data that stores the matrix. Don't ruin the pointers. Generally, don't mess with this unless you really, really need to be clever. More...


Protected Attributes

int Xmin
int Ymin
int Xmax
int Ymax
int TotSize
int TotX
int TotY

Detailed Description

template<class T>
class CMatrix< T >

A Two dimensional matrix class.

The only things defined in this class are the necessary files for creating 2 dimensional array type things. The Math functions are implemented separately in 'matrixarith' There are no requirements placed upon the type used by this class. It can hold anything.

Definition at line 14 of file CMatrix.


Constructor & Destructor Documentation

template<class T>
CMatrix< T >::CMatrix
 

Definition at line 88 of file CMatrix.

template<class T>
CMatrix< T >::CMatrix int x,
int y
 

Definition at line 94 of file CMatrix.

template<class T>
CMatrix< T >::~CMatrix [virtual]
 

Definition at line 183 of file CMatrix.


Member Function Documentation

template<class T>
void CMatrix< T >::Initialize T val [inline]
 

Stores 'val' at all locations in the matrix.

Definition at line 48 of file CMatrix.

template<class T>
void CMatrix< T >::SetRange CMatrix< T > OLD,
bool copy = true
[inline]
 

Set the range based upon another matrix.

Definition at line 60 of file CMatrix.

template<class T>
void CMatrix< T >::SetRange int xtop,
int ytop,
int xbottom,
int ybottom,
bool copy = true
 

Set the maximum and minimum values for the range of the CMatrix; This will resize the CMatrix to the necessary size, adding or deleting the necessary amount. Please note that this requires the creation of more memory before the destruction of the old memory.

If you don't care about copying the old values from the array, set copy=false. Otherwise, ignore it (don't put a value there)

Definition at line 139 of file CMatrix.

Referenced by SetRange(), convolve(), and operator=().

template<class T>
void CMatrix< T >::SetSize int x,
int y
 

This sets the minimum CMatrix coordinates to (0,0), and the max to x, y.

Definition at line 177 of file CMatrix.

Referenced by GreyImage::Read(), convolve(), derivet(), derivex(), derivey(), and transpose().

template<class T>
double CMatrix< T >::interpolate double x,
double y
 

Performs bilinear interpolation (given the four nearest neighbors).

Definition at line 114 of file CMatrix.

template<class T>
T & CMatrix< T >::operator() const unsigned int x,
const unsigned int y
 

Access an individual element using this.

Definition at line 105 of file CMatrix.

template<class T>
CMatrix< T > & CMatrix< T >::operator= CMatrix< T > & RHS
 

Used to copy one matrix to another using the assignment operator.

Definition at line 127 of file CMatrix.

template<class T>
T& CMatrix< T >::operator[] const unsigned int val [inline]
 

Useful if you consider the matrix to be single dimensional by lining up the rows.

Definition at line 46 of file CMatrix.

template<class T>
int CMatrix< T >::size [inline]
 

Total number of elements in the matrix.

Definition at line 34 of file CMatrix.

Referenced by Initialize(), GreyImage::Read(), GreyImage::Write(), and convolve().

template<class T>
int CMatrix< T >::x [inline]
 

Total width of image.

Definition at line 36 of file CMatrix.

Referenced by GreyImage::Write(), and dotprod().

template<class T>
int CMatrix< T >::xmax [inline]
 

Maximum defined x value (1 greater than the farthest element to the right).

Definition at line 26 of file CMatrix.

Referenced by SetRange(), convolve(), derivet(), dotprod(), operator=(), samedimen(), and transpose().

template<class T>
int CMatrix< T >::xmin [inline]
 

Minimum defined x value (farthest left element).

Definition at line 30 of file CMatrix.

Referenced by SetRange(), convolve(), derivet(), dotprod(), operator=(), samedimen(), and transpose().

template<class T>
int CMatrix< T >::y [inline]
 

Total height of image.

Definition at line 38 of file CMatrix.

Referenced by GreyImage::Write(), and dotprod().

template<class T>
int CMatrix< T >::ymax [inline]
 

Maximum defined y value (1 greater than the farthest element at the bottom).

Definition at line 28 of file CMatrix.

Referenced by SetRange(), convolve(), derivet(), dotprod(), operator=(), samedimen(), and transpose().

template<class T>
int CMatrix< T >::ymin [inline]
 

Minimum defined y value (closest to top element).

Definition at line 32 of file CMatrix.

Referenced by SetRange(), convolve(), derivet(), dotprod(), operator=(), samedimen(), and transpose().


Member Data Documentation

template<class T>
int CMatrix::TotSize [protected]
 

Definition at line 67 of file CMatrix.

template<class T>
int CMatrix::TotX [protected]
 

Definition at line 67 of file CMatrix.

template<class T>
int CMatrix::TotY [protected]
 

Definition at line 67 of file CMatrix.

template<class T>
int CMatrix::Xmax [protected]
 

Definition at line 67 of file CMatrix.

template<class T>
int CMatrix::Xmin [protected]
 

Definition at line 67 of file CMatrix.

template<class T>
int CMatrix::Ymax [protected]
 

Definition at line 67 of file CMatrix.

template<class T>
int CMatrix::Ymin [protected]
 

Definition at line 67 of file CMatrix.

template<class T>
T* CMatrix::m_CMatrix
 

The actual data that stores the matrix. Don't ruin the pointers. Generally, don't mess with this unless you really, really need to be clever.

Definition at line 65 of file CMatrix.

template<class T>
T * CMatrix::zeroloc
 

The actual data that stores the matrix. Don't ruin the pointers. Generally, don't mess with this unless you really, really need to be clever.

Definition at line 65 of file CMatrix.


The documentation for this class was generated from the following file:
Generated at Thu Apr 25 20:30:41 2002 for SuperParr by doxygen1.2.9.1 written by Dimitri van Heesch, © 1997-2001