Diffpack Documentation
Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members File Members Search
very simple matrix, only allocation and subscripting.
More...
#include <MatSimplest_Type.h>
Inheritance diagram for MatSimplest(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
|
|
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. |
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]
|
|
|
|
returns the number of columns. |
|
|
checks if the object has compatible sizes with the object given as argument. |
|
const Type * MatSimplest(Type)::getData (
|
) const [inline]
|
|
|
Type * MatSimplest(Type)::getVec (
|
int base = 1 ) [inline]
|
|
|
bool MatSimplest(Type)::indexOk (
|
int i,
|
|
int j,
|
|
const char * message = NULL ) const
|
|
|
bool MatSimplest(Type)::makeNew (
|
int nrows,
|
|
int ncolumns ) [protected]
|
|
|
|
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). |
|
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). |
|
|
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
The documentation for this class was generated from the following file:
Copyright © 2003 inuTech GmbH. All rights reserved.