GCLgrid :: dmatrix classes

class dmatrix

? ^ 
Lightweight, simple double precision matrix object.

Provides basic matrix functionality. Note that elements of the matrix are stored internally in FORTRAN order but using C style indexing. That is, all indices begin at 0, not 1 and run to size - 1. Further, FORTRAN order means the elements are actually ordered in columns as in FORTRAN in a continuous, logical block of memory. This allow one to use the BLAS functions to access the elements of the matrix. As usual be warned this is useful for efficiency and speed, but completely circumvents the bounds checking used by methods in the object.

Source:
dmatrix.h:105
Author:
Robert R and Gary L. Pavlis
Version:
unknown
Friends:
function dmatrixoperator+ Add two matrices.

X=A+B.

function dmatrixoperator- Take the difference of two matrices.

X=A-B.

function dmatrixoperator* Multiply two matrices.

X=A*B.

function dmatrixoperator* Scale a matrix by a constant.

X=c*A where c is a constant.

function dmatrixoperator/ Divide each element of a matrix by a constant.

X=A/c where c is a scalar.

function dmatrixtr Transpose a matrix.

Given X, returns X^T.

function ostream&operator<< Output stream operator for a matrix.
function istream&operator>> Input stream operator for a matrix.

Contents

^ 
EntityTypeScopeShort Description
~dmatrixdestructor public Destructor.
dmatrixconstructor public Default constructor.
dmatrixconstructor public Basic constructor.
dmatrixconstructor public Standard copy constructor
columnsmethod public Return the number of columns in this matrix.
get_addressmethod public Return a pointer to an element (r,c) of matrix.
operator ()operator public Indexing operator for a matrix object.
operator +=operator public Adds one matrix to another.
operator -=operator public Subtracts one matrix from another.
operator =operator public Standard assignment operator
rowsmethod public Return the number of rows in this matrix.
sizemethod public Get the size of this matrix.
zeromethod public Initialize a matrix to all zeros.

destructor ~dmatrix

? ^  > 
Destructor.

Nothing special.

Source:
dmatrix.h:125
Code:
public ~ dmatrix ( )

constructor dmatrix

? ^  < > 
Default constructor.

Produces a 1x1 matrix as a place holder.

Source:
dmatrix.h:110
Code:
public dmatrix ( )

constructor dmatrix

? ^  < > 
Basic constructor.

Allocates space for nr x nc array.

Source:
dmatrix.h:116
Params:
nr number of rows to allocate for this matrix.
nc number of columns to allocate for this matrix.
Code:
public dmatrix ( int nr ,
int nc )

constructor dmatrix

? ^  < > 
Standard copy constructor
Source:
dmatrix.h:121
Param:
other matrix to be copied/
Code:
public dmatrix ( const dmatrix & other )

method columns

? ^  < > 
Return the number of columns in this matrix.

Source:
dmatrix.h:206
Code:
public int columns ( )

method get_address

? ^  < > 
Return a pointer to an element (r,c) of matrix.

This is most useful in constructs using the BLAS that require a pointer reference to an element of a matrix.

Source:
dmatrix.h:184
Params:
r is row index requested.
c is column index requested.
Exception:
dmatrix_index_erroris thrown if request is out of range
Code:
public double * get_address ( int r ,
int c )

operator ()

? ^  < > 
Indexing operator for a matrix object.

Gets value of matrix at (rowindex,colindex).

Source:
dmatrix.h:134
Params:
rowindex row to fetch
colindex column to fetch.
Returns:
Reference to matrix element at position (rowindex,colindex)
Exception:
dmatrix_index_erroris thrown if request is out of range
Code:
public double & operator () ( int rowindex ,
int colindex )

operator +=

? ^  < > 
Adds one matrix to another.

X->X+A where A is right hand side.

Source:
dmatrix.h:143
Exception:
dmatrix_size_erroris thrown if two matrices are not of the same size
Code:
public void operator += ( const dmatrix & other )

operator -=

? ^  < > 
Subtracts one matrix from another.

X->X-A where A is right hand side.

Source:
dmatrix.h:148
Exception:
dmatrix_size_erroris thrown if two matrices are not of the same size
Code:
public void operator -= ( const dmatrix & other )

operator =

? ^  < > 
Standard assignment operator
Source:
dmatrix.h:138
Code:
public void operator = ( const dmatrix & other )

method rows

? ^  < > 
Return the number of rows in this matrix.
Source:
dmatrix.h:202
Code:
public int rows ( )

method size

? ^  < > 
Get the size of this matrix.

User must delete [] the result. User should use rows() and columns() method in preference to this.

Source:
dmatrix.h:198
Returns:
Two element int vector with row=[0] and column=[1].
Code:
public int * size ( )

method zero

? ^  < > 
Initialize a matrix to all zeros.
Source:
dmatrix.h:210
Code:
public void zero ( )

Created Fri Jan 21 08:54:55 2005.
This documentation was generated automatically by
ccdoc v08r41 2004/09/29 bin_opt_suncc_sun4-solaris-2.8.
Click here to submit a bug report or feature request for ccdoc.
Click here to return to the top of the page.