Diffpack Documentation


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

MatSimplest(Type) Class Reference

very simple matrix, only allocation and subscripting. More...

#include <MatSimplest_Type.h>

Inheritance diagram for MatSimplest(Type)::

MatSimple_Type MatSimplestH_Type Mat_Type MatSimpleH_Type List of all members.

Public Methods

 MatSimplest(Type) ()
 MatSimplest(Type) (int nrows, int ncolumns)
 MatSimplest(Type) (Type **a, int m, int n, int base=1)
virtual ~MatSimplest(Type) ()
bool redim (int nrows, int ncolumns)
bool ok () const
void size (int &nrows_, int &ncolumns_) const
int rows () const
int columns () const
bool compatible (const MatSimplest(Type) &X) const
bool indexOk (int i, int j, const char *message=NULL) const
const Type& operator() (int i, int j) const
Type& operator() (int i, int j)
Type** getPtr1 ()
const Type* getData () const
Type* getData ()
Type* getVec (int base=1)
int getVecSize () const
Type* operator[] (int i)

Static Public Attributes

long nbytes
long nbytes_dealloc
long narrays
long narrays_dealloc
real report_ifgt

Protected Methods

bool makeNew (int nrows, int ncolumns)
Type** allocate (int nrows, int ncolumns)
void deallocate ()
void borrow (Type **a, int m, int n, int base=0)

Protected Attributes

Type** A
int nrows
int ncolumns
bool internal

Detailed Description

very simple matrix, only allocation and subscripting.

NAME: MatSimplest(Type) - very simple matrix, only allocation and subscripting

DESCRIPTION:

The class implements a standard matrix type. The public interface consists only of two constructors, a subscripting operator and some size information. In addition, the double pointer representation of the matrix can be returned from a member function (e.g. when using this matrix in a C function). The row and column bases are unity. More operations, included "print", "fill", "operator=", copy-constructors, "operator<<" etc., can be found in the derived class "MatSimple(Type)". If arithmetic operations have meanings (e.g. when "Type" is "float", "double" or "Complex") one can use the standard class "Mat(Type)" which is derived from "MatSimple(Type)". A general base for the subscripting operator is provided in "ArrayGenSimplest(Type)".

Since no operations, execpt a constructor without arguments, is assumed to exist for "Type", this matrix class can be used as a general class for collecting (complicated) objects in a matrix.


Constructor & Destructor Documentation

MatSimplest(Type)::MatSimplest_Type ( )
 

Two constructors are available. The constructor without parameters allocates no memory. To allocate the proper amount of memory at a later stage, the "redim" function can be used. Another constructor takes the number of rows and columns in the matrix as parameters and allocates memory for the corresponding matrix representation.

To initialize the matrix entries one must use the member function "operator()".

A new feature allows declaration of arrays with zero length.

MatSimplest(Type)::MatSimplest_Type ( int nrows,
int ncolumns )
 

See documentation of one of the overloaded constructor.

MatSimplest(Type)::MatSimplest_Type ( Type ** a,
int m,
int n,
int base = 1 )
 

See documentation of one of the overloaded constructor.

MatSimplest(Type)::~MatSimplest(Type) ( ) [virtual]
 


Member Function Documentation

Type ** MatSimplest(Type)::allocate ( int nrows,
int ncolumns ) [protected]
 

void MatSimplest(Type)::borrow ( Type ** a,
int m,
int n,
int base = 0 ) [protected]
 

int MatSimplest(Type)::columns ( ) const [inline]
 

returns the number of columns.

bool MatSimplest(Type)::compatible ( const MatSimplest(Type) & X ) const
 

checks if the object has compatible sizes with the object given as argument.

void MatSimplest(Type)::deallocate ( ) [protected]
 

Type * MatSimplest(Type)::getData ( ) [inline]
 

const Type * MatSimplest(Type)::getData ( ) const [inline]
 

Type ** MatSimplest(Type)::getPtr1 ( ) [inline]
 

Type * MatSimplest(Type)::getVec ( int base = 1 ) [inline]
 

int MatSimplest(Type)::getVecSize ( ) const [inline]
 

bool MatSimplest(Type)::indexOk ( int i,
int j,
const char * message = NULL ) const
 

bool MatSimplest(Type)::makeNew ( int nrows,
int ncolumns ) [protected]
 

bool MatSimplest(Type)::ok ( ) const
 

returns "true" if the object is in an ok state, that is, if memory is allocated for the matrix. In an ok state one can make the call "operator() (1,1)" (at least one entry is present in the matrix).

Type & MatSimplest(Type)::operator() ( int i,
int j )
 

const Type & MatSimplest(Type)::operator() ( int i,
int j ) const
 

Type * MatSimplest(Type)::operator[] ( int i ) [inline]
 

bool MatSimplest(Type)::redim ( int nrows,
int ncolumns )
 

changes the dimension of the matrix (if necessary).

Reimplemented in Mat(Type).

int MatSimplest(Type)::rows ( ) const [inline]
 

returns the number of rows.

void MatSimplest(Type)::size ( int & m,
int & n ) const [inline]
 

returns the number of rows and columns.

Reimplemented in Mat(Type).


Member Data Documentation

Type ** MatSimplest(Type)::A [protected]
 

bool MatSimplest(Type)::internal [protected]
 

long MatSimplest(Type)::narrays [static]
 

long MatSimplest(Type)::narrays_dealloc [static]
 

long MatSimplest(Type)::nbytes [static]
 

long MatSimplest(Type)::nbytes_dealloc [static]
 

int MatSimplest(Type)::ncolumns [protected]
 

int MatSimplest(Type)::nrows [protected]
 

real MatSimplest(Type)::report_ifgt [static]
 


The documentation for this class was generated from the following file:
Copyright © 2003 inuTech GmbH. All rights reserved.