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

Matrix Template Class Reference

Matrix is a pure, virtual, base class defining the concept of a twodimensional Matrix for the purpose of numerical computations. More...

#include <matrix.h>

Inheritance diagram for Matrix:

MatrixC MatrixSP MatrixBD MatrixFD MatrixFI MatrixSD VectorD VectorI List of all members.

Public Methods

virtual ~Matrix ()
 virtual destructor.

virtual int nr (const int i=0) const = 0
 number of rows.

virtual int nc (const int i=0) const = 0
 number of columns.

virtual int size () const = 0
 size is the number of elements of the Matrix.

virtual bool empty () const = 0
 true if the Matrix is empty.

virtual Ref<Tp> operator() (const int i, const int j=0) = 0
 operator() is slower because of copy on write checking.

virtual Tp operator() (const int i, const int j=0) const = 0
 and its read only pendant for fast read access.


Protected Methods

virtual Tp* ref (const int i, const int j) const = 0
 low level reference to data.

virtual Tp read (const int i, const int j) const = 0
 low level read access.

virtual void write (const int i, const int j, const Tp v) = 0
 low level write access.

virtual void add (const int i, const int j, const Tp v) = 0
 low level add to value.

virtual void sub (const int i, const int j, const Tp v) = 0
 low level sub from value.

virtual void mul (const int i, const int j, const Tp v) = 0
 low level mul with value.

virtual void div (const int i, const int j, const Tp v) = 0
 low level div by value.


Detailed Description

template<class Tp> template class Matrix

Matrix is a pure, virtual, base class defining the concept of a twodimensional Matrix for the purpose of numerical computations.

Author(s):
rokrau
Date:
2000/11/21 17:03:07

The class implements copy on write and provides an interface to some very basic methods and properties of the Matrix.

The most important operator() enables public access to the coefficients of the Matrix. The mechanism of returning a Ref<Tp> object for non constant access and overloading certain operators, that change the value of the operand with low level access functions, ensures that Matrix data is never quietly changed.

Methods nr() and nc() return the number of rows and the number of columns resp.. Both methods can have an optional argument that is for general banded matrices and specifies the row and column number resp..


Constructor & Destructor Documentation

template<classTp>
Matrix<Tp>::~Matrix<Tp> ( ) [inline, virtual]
 

virtual destructor.


Member Function Documentation

template<classTp>
int Matrix<Tp>::nr ( const int i = 0 ) const [pure virtual]
 

number of rows.

Reimplemented in MatrixC, MatrixBD, MatrixSD, and MatrixSP.

template<classTp>
int Matrix<Tp>::nc ( const int i = 0 ) const [pure virtual]
 

number of columns.

Reimplemented in MatrixC, MatrixBD, MatrixSD, and MatrixSP.

template<classTp>
int Matrix<Tp>::size ( ) const [pure virtual]
 

size is the number of elements of the Matrix.

Reimplemented in MatrixC, and MatrixSP.

template<classTp>
bool Matrix<Tp>::empty ( ) const [pure virtual]
 

true if the Matrix is empty.

Reimplemented in MatrixC, and MatrixSP.

template<classTp>
Ref< Tp > Matrix<Tp>::operator() ( const int i,
const int j = 0 ) [pure virtual]
 

operator() is slower because of copy on write checking.

Reimplemented in MatrixC, MatrixBD, MatrixSD, MatrixSP, VectorD, and VectorI.

template<classTp>
Tp Matrix<Tp>::operator() ( const int i,
const int j = 0 ) const [pure virtual]
 

and its read only pendant for fast read access.

Reimplemented in MatrixC, MatrixBD, MatrixSD, MatrixSP, VectorD, and VectorI.

template<classTp>
Tp * Matrix<Tp>::ref ( const int i,
const int j ) const [protected, pure virtual]
 

low level reference to data.

Reimplemented in MatrixC, MatrixBD, MatrixSD, and MatrixSP.

template<classTp>
Tp Matrix<Tp>::read ( const int i,
const int j ) const [protected, pure virtual]
 

low level read access.

Reimplemented in MatrixC, MatrixBD, MatrixSD, and MatrixSP.

template<classTp>
void Matrix<Tp>::write ( const int i,
const int j,
const Tp v ) [protected, pure virtual]
 

low level write access.

Reimplemented in MatrixC.

template<classTp>
void Matrix<Tp>::add ( const int i,
const int j,
const Tp v ) [protected, pure virtual]
 

low level add to value.

Reimplemented in MatrixC.

template<classTp>
void Matrix<Tp>::sub ( const int i,
const int j,
const Tp v ) [protected, pure virtual]
 

low level sub from value.

Reimplemented in MatrixC.

template<classTp>
void Matrix<Tp>::mul ( const int i,
const int j,
const Tp v ) [protected, pure virtual]
 

low level mul with value.

Reimplemented in MatrixC.

template<classTp>
void Matrix<Tp>::div ( const int i,
const int j,
const Tp v ) [protected, pure virtual]
 

low level div by value.

Reimplemented in MatrixC.


The documentation for this class was generated from the following file:
Generated at Wed Nov 22 08:38:29 2000 for LinAl - a simple and efficient Matrix library - by doxygen1.2.1 written by Dimitri van Heesch, © 1997-2000