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

MatrixSP Class Reference

#include <matrixSP.h>

Inheritance diagram for MatrixSP:

Matrix List of all members.

Public Types

enum  status {
  open = 0,
  closed = 1
}
 sparse matrices are either closed or open. More...


Public Methods

 MatrixSP (const int nc=0,const status S=open)
 standard constructor has an optional status paramater.

 MatrixSP (const int _ncol, const int _nel, const status _s=closed)
 constructor for a closed sparse matrix.

 MatrixSP (const MatrixSP& B)
 copy constructor.

virtual ~MatrixSP ()
 virtual destructor.

virtual MatrixSP& operator= (const MatrixSP& B)
 assignment operator.

virtual MatrixSP& operator= (const double value)
 assignment with a constant value.

void get_own_copy ()
 get own copy of matrix data.

void set_open ()
 open matrix for editing values.

void set_closed ()
 close matrix for fast access.

bool is_open ()
 check whether matrix is open for editing.

void resize (const int nc, const double value=0)
 resize Matrix.

virtual int nr (const int i=0) const
 number of row elements returns for column i.

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

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

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

double* get_m () const
 return a pointer to the double array containing the data.

int* get_ia () const
 return a pointer to the int array containing the row indices.

int* get_izh () const
 return a pointer to the int array containing the diagonal element indices.

virtual Ref<double> operator() (const int i, const int j=0)
 non constant, write access to elements.

virtual double operator() (const int i, const int j=0) const
 constant, read only access to elements.

virtual bool operator== (const MatrixSP &B)
 logical operator equal, as in the STL.

virtual bool operator< (const MatrixSP &B)
 logical operator lesser then, as in the STL.


Protected Methods

vectorsp& operator[] (const int i) const
 fast sequential access operator[], available to members only.

double* ref (const int i, const int j) const
 low level reference to data returns a pointer, use this with care.

double read (const int i, const int j) const
 low level read.

void write (const int i, const int j, const double v)
 low level write.

void add (const int i, const int j, const double v)
 low level add to.

void sub (const int i, const int j, const double v)
 low level sub from.

void mul (const int i, const int j, const double v)
 low level mul with.

void div (const int i, const int j, const double v)
 low level div by.


Protected Attributes

MrepSPD

Friends

istream& operator>> (istream& s, MatrixSP& M)
 input stream operator for a sparse matrix.

ostream& operator<< (ostream& s, const MatrixSP& M)
 output stream operator for a sparse matrix.


Member Enumeration Documentation

enum MatrixSP::status
 

sparse matrices are either closed or open.

Enumeration values:
open  
closed  


Constructor & Destructor Documentation

MatrixSP::MatrixSP ( const int nc = 0,
const status S = open ) [inline]
 

standard constructor has an optional status paramater.

MatrixSP::MatrixSP ( const int _ncol,
const int _nel,
const status _s = closed ) [inline]
 

constructor for a closed sparse matrix.

MatrixSP::MatrixSP ( const MatrixSP & B ) [inline]
 

copy constructor.

MatrixSP::~MatrixSP ( ) [inline, virtual]
 

virtual destructor.


Member Function Documentation

MatrixSP & MatrixSP::operator= ( const MatrixSP & B ) [inline, virtual]
 

assignment operator.

MatrixSP & MatrixSP::operator= ( const double value ) [inline, virtual]
 

assignment with a constant value.

void MatrixSP::get_own_copy ( ) [inline]
 

get own copy of matrix data.

void MatrixSP::set_open ( ) [inline]
 

open matrix for editing values.

void MatrixSP::set_closed ( ) [inline]
 

close matrix for fast access.

bool MatrixSP::is_open ( ) [inline]
 

check whether matrix is open for editing.

void MatrixSP::resize ( const int nc,
const double value = 0 ) [inline]
 

resize Matrix.

int MatrixSP::nr ( const int i = 0 ) const [inline, virtual]
 

number of row elements returns for column i.

Reimplemented from Matrix.

int MatrixSP::nc ( const int i = 0 ) const [inline, virtual]
 

number of columns.

Reimplemented from Matrix.

int MatrixSP::size ( ) const [inline, virtual]
 

size is the number of elements of the Matrix.

Reimplemented from Matrix.

bool MatrixSP::empty ( ) const [inline, virtual]
 

true if the Matrix is empty.

Reimplemented from Matrix.

double * MatrixSP::get_m ( ) const [inline]
 

return a pointer to the double array containing the data.

int * MatrixSP::get_ia ( ) const [inline]
 

return a pointer to the int array containing the row indices.

int * MatrixSP::get_izh ( ) const [inline]
 

return a pointer to the int array containing the diagonal element indices.

vectorsp & MatrixSP::operator[] ( const int i ) const [inline, protected]
 

fast sequential access operator[], available to members only.

Ref< double > MatrixSP::operator() ( const int i,
const int j = 0 ) [inline, virtual]
 

non constant, write access to elements.

Reimplemented from Matrix.

double MatrixSP::operator() ( const int i,
const int j = 0 ) const [inline, virtual]
 

constant, read only access to elements.

Reimplemented from Matrix.

double * MatrixSP::ref ( const int i,
const int j ) const [inline, protected, virtual]
 

low level reference to data returns a pointer, use this with care.

Reimplemented from Matrix.

double MatrixSP::read ( const int i,
const int j ) const [inline, protected, virtual]
 

low level read.

Reimplemented from Matrix.

void MatrixSP::write ( const int i,
const int j,
const double v ) [inline, protected]
 

low level write.

void MatrixSP::add ( const int i,
const int j,
const double v ) [inline, protected]
 

low level add to.

void MatrixSP::sub ( const int i,
const int j,
const double v ) [inline, protected]
 

low level sub from.

void MatrixSP::mul ( const int i,
const int j,
const double v ) [inline, protected]
 

low level mul with.

void MatrixSP::div ( const int i,
const int j,
const double v ) [inline, protected]
 

low level div by.

bool MatrixSP::operator== ( const MatrixSP & B ) [inline, virtual]
 

logical operator equal, as in the STL.

bool MatrixSP::operator< ( const MatrixSP & B ) [inline, virtual]
 

logical operator lesser then, as in the STL.


Friends And Related Function Documentation

istream& operator>> ( istream & s,
MatrixSP & M ) [friend]
 

input stream operator for a sparse matrix.

ostream& operator<< ( ostream & s,
const MatrixSP & M ) [friend]
 

output stream operator for a sparse matrix.


Member Data Documentation

MrepSP * MatrixSP::D [protected]
 


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