MOOCHO (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | List of all members
AbstractLinAlgPack::COOMatrix Class Reference

Sparse Coordinate Matrix abstraction storage class. More...

#include <AbstractLinAlgPack_COOMatrixClass.hpp>

Public Member Functions

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

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. More...
 

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. More...
 
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. More...
 
const indice_typejvect () const
 
const indice_typeconst_jvect () const
 
void initialize (std::istream &istrm)
 Initialize from an input stream. More...
 

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 61 of file AbstractLinAlgPack_COOMatrixClass.hpp.

Member Typedef Documentation

Definition at line 72 of file AbstractLinAlgPack_COOMatrixClass.hpp.

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

Definition at line 74 of file AbstractLinAlgPack_COOMatrixClass.hpp.

Definition at line 76 of file AbstractLinAlgPack_COOMatrixClass.hpp.

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

Definition at line 173 of file AbstractLinAlgPack_COOMatrixClass.hpp.

Definition at line 175 of file AbstractLinAlgPack_COOMatrixClass.hpp.

Definition at line 177 of file AbstractLinAlgPack_COOMatrixClass.hpp.

Constructor & Destructor Documentation

AbstractLinAlgPack::COOMatrix::COOMatrix ( )
inline

Consturct with no storage allocated.

Definition at line 198 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 201 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 204 of file AbstractLinAlgPack_COOMatrixClass.hpp.

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

Definition at line 207 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 211 of file AbstractLinAlgPack_COOMatrixClass.hpp.

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

Definition at line 214 of file AbstractLinAlgPack_COOMatrixClass.hpp.

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

Definition at line 217 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 220 of file AbstractLinAlgPack_COOMatrixClass.hpp.

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

Definition at line 223 of file AbstractLinAlgPack_COOMatrixClass.hpp.

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

Definition at line 226 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 229 of file AbstractLinAlgPack_COOMatrixClass.hpp.

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

Definition at line 232 of file AbstractLinAlgPack_COOMatrixClass.hpp.

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

Definition at line 235 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

size_type AbstractLinAlgPack::COOMatrix::rows_
private

Definition at line 182 of file AbstractLinAlgPack_COOMatrixClass.hpp.

size_type AbstractLinAlgPack::COOMatrix::cols_
private

Definition at line 182 of file AbstractLinAlgPack_COOMatrixClass.hpp.

size_type AbstractLinAlgPack::COOMatrix::nz_
private

Definition at line 182 of file AbstractLinAlgPack_COOMatrixClass.hpp.

va_value_type AbstractLinAlgPack::COOMatrix::val_
private

Definition at line 185 of file AbstractLinAlgPack_COOMatrixClass.hpp.

va_indice_ref_type AbstractLinAlgPack::COOMatrix::ivect_ref_
private

Definition at line 186 of file AbstractLinAlgPack_COOMatrixClass.hpp.

va_indice_ref_type AbstractLinAlgPack::COOMatrix::jvect_ref_
private

Definition at line 186 of file AbstractLinAlgPack_COOMatrixClass.hpp.


The documentation for this class was generated from the following file: