AbstractLinAlgPack::COOMatrix Class Reference

Sparse Coordinate Matrix abstraction storage class. More...

#include <AbstractLinAlgPack_COOMatrixClass.hpp>

List of all members.

Public Member Functions

COOMatrixoperator= (const COOMatrix &coom)
 Assignment operator.
void resize (size_type rows, size_type cols, size_type nz)
 Resize for a rows# by cols# sparse matrix with nz# elements.
size_type rows () const
 Return the number of rows in the row access view.
size_type cols () const
 Returns the number of columns in the column access view.
size_type nz () const

{\bf Public Typedefs}



typedef
AbstractLinAlgPack::size_type 
size_type
 
typedef
AbstractLinAlgPack::indice_type 
indice_type
 
typedef
AbstractLinAlgPack::value_type 
value_type
 

COO matrix representation access.

These member functions give access the the val#, ivect# and jvect# arrays used to store the underlying nonzero elements of the full matrix.

Since sharing can be used between COOMatrix objects the client should call the 'const_' functions if they are only going to be reading these data since if the others are called on a nonconst object then if ivect# or jvect# is being shared then a freash copy would be made unnecesarily.



typedef MemMngPack::RefCount
< std::valarray< indice_type > > 
va_indice_ref_type
typedef std::valarray< value_typeva_value_type
typedef std::valarray
< indice_type
va_indice_type
size_type rows_
size_type cols_
size_type nz_
va_value_type val_
va_indice_ref_type ivect_ref_
va_indice_ref_type jvect_ref_
value_typeval ()
 Return pointer to raw storage array (length nz()#) for the values of the non-zero elements.
const value_typeval () const
 
const value_typeconst_val () const
 
indice_typeivect ()
 
const indice_typeivect () const
 
const indice_typeconst_ivect () const
 
indice_typejvect ()
 Return pointer to raw storage array (length nz()#) for the column indices of the non-zero elements.
const indice_typejvect () const
 
const indice_typeconst_jvect () const
 
void initialize (std::istream &istrm)
 Initialize from an input stream.

Constructors.

The default copy constructor is used since it has the correct implementation (memberwise assignment and not binary copy). In the default copy constructor, initially these objects will share memory for ivect#, jvect#. Initially only val# is allocated and made unique. If the sparsity information of the matrix does not change then the value of the nonzero elements can be changed without further allocations. If however, the row and/or column access in changed, or ivect or jvect is changed then new allocations will be performed.



 COOMatrix ()
 Consturct with no storage allocated.

Detailed Description

Sparse Coordinate Matrix abstraction storage class.

This class abstracts a fortran style sparse coordinate matrix which is stored is three vectors: (val, ivect, jvect). This class allows direct access to these arrays for integration with fortran function calls.

The row and column indices represented by this class must be 1-based.

Definition at line 48 of file AbstractLinAlgPack_COOMatrixClass.hpp.


Member Typedef Documentation

Definition at line 59 of file AbstractLinAlgPack_COOMatrixClass.hpp.

typedef AbstractLinAlgPack::indice_type AbstractLinAlgPack::COOMatrix::indice_type

Definition at line 61 of file AbstractLinAlgPack_COOMatrixClass.hpp.

Definition at line 63 of file AbstractLinAlgPack_COOMatrixClass.hpp.

typedef MemMngPack::RefCount< std::valarray<indice_type> > AbstractLinAlgPack::COOMatrix::va_indice_ref_type [private]

Definition at line 160 of file AbstractLinAlgPack_COOMatrixClass.hpp.

typedef std::valarray<value_type> AbstractLinAlgPack::COOMatrix::va_value_type [private]

Definition at line 162 of file AbstractLinAlgPack_COOMatrixClass.hpp.

Definition at line 164 of file AbstractLinAlgPack_COOMatrixClass.hpp.


Constructor & Destructor Documentation

AbstractLinAlgPack::COOMatrix::COOMatrix (  )  [inline]

Consturct with no storage allocated.

Definition at line 185 of file AbstractLinAlgPack_COOMatrixClass.hpp.


Member Function Documentation

COOMatrix& AbstractLinAlgPack::COOMatrix::operator= ( const COOMatrix coom  ) 

Assignment operator.

This function has similar behavior w.r.t sharing that the copy constructor has accept any current storage will be deallocated.

void AbstractLinAlgPack::COOMatrix::resize ( size_type  rows,
size_type  cols,
size_type  nz 
)

Resize for a rows# by cols# sparse matrix with nz# elements.

Any sharing if row or column indices is lost.

COOMatrix::size_type AbstractLinAlgPack::COOMatrix::rows (  )  const [inline]

Return the number of rows in the row access view.

Definition at line 188 of file AbstractLinAlgPack_COOMatrixClass.hpp.

COOMatrix::size_type AbstractLinAlgPack::COOMatrix::cols (  )  const [inline]

Returns the number of columns in the column access view.

Definition at line 191 of file AbstractLinAlgPack_COOMatrixClass.hpp.

COOMatrix::size_type AbstractLinAlgPack::COOMatrix::nz (  )  const [inline]

Definition at line 194 of file AbstractLinAlgPack_COOMatrixClass.hpp.

COOMatrix::value_type * AbstractLinAlgPack::COOMatrix::val (  )  [inline]

Return pointer to raw storage array (length nz()#) for the values of the non-zero elements.

Definition at line 198 of file AbstractLinAlgPack_COOMatrixClass.hpp.

const COOMatrix::value_type * AbstractLinAlgPack::COOMatrix::val (  )  const [inline]

Definition at line 201 of file AbstractLinAlgPack_COOMatrixClass.hpp.

const COOMatrix::value_type * AbstractLinAlgPack::COOMatrix::const_val (  )  const [inline]

Definition at line 204 of file AbstractLinAlgPack_COOMatrixClass.hpp.

COOMatrix::indice_type * AbstractLinAlgPack::COOMatrix::ivect (  )  [inline]

Return pointer to raw storage array (length nz()#) for the row indices of the non-zero elements

Definition at line 207 of file AbstractLinAlgPack_COOMatrixClass.hpp.

const COOMatrix::indice_type * AbstractLinAlgPack::COOMatrix::ivect (  )  const [inline]

Definition at line 210 of file AbstractLinAlgPack_COOMatrixClass.hpp.

const COOMatrix::indice_type * AbstractLinAlgPack::COOMatrix::const_ivect (  )  const [inline]

Definition at line 213 of file AbstractLinAlgPack_COOMatrixClass.hpp.

COOMatrix::indice_type * AbstractLinAlgPack::COOMatrix::jvect (  )  [inline]

Return pointer to raw storage array (length nz()#) for the column indices of the non-zero elements.

Definition at line 216 of file AbstractLinAlgPack_COOMatrixClass.hpp.

const COOMatrix::indice_type * AbstractLinAlgPack::COOMatrix::jvect (  )  const [inline]

Definition at line 219 of file AbstractLinAlgPack_COOMatrixClass.hpp.

const COOMatrix::indice_type * AbstractLinAlgPack::COOMatrix::const_jvect (  )  const [inline]

Definition at line 222 of file AbstractLinAlgPack_COOMatrixClass.hpp.

void AbstractLinAlgPack::COOMatrix::initialize ( std::istream &  istrm  ) 

Initialize from an input stream.

The format for the imput is:

m n nz#\ a1:i1:j1 a2:i2:j2 .... anz:inz:jnz#\

In the above format, each non-zero element is given as a three item pair: value of the non-zero element, row indice (1-based) of the non-zero element, and the column indice (1-based) of the non-zero element. There must be no spaces between the numbers and the \':\' charachter and there must be at least one whitespace character between elements.


Member Data Documentation

Definition at line 169 of file AbstractLinAlgPack_COOMatrixClass.hpp.

Definition at line 169 of file AbstractLinAlgPack_COOMatrixClass.hpp.

Definition at line 169 of file AbstractLinAlgPack_COOMatrixClass.hpp.

Definition at line 172 of file AbstractLinAlgPack_COOMatrixClass.hpp.

Definition at line 173 of file AbstractLinAlgPack_COOMatrixClass.hpp.

Definition at line 173 of file AbstractLinAlgPack_COOMatrixClass.hpp.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Generated on Wed Apr 13 10:17:30 2011 for MOOCHO (Single Doxygen Collection) by  doxygen 1.6.3