AbstractLinAlgPack: C++ Interfaces For Vectors, Matrices And Related Linear Algebra Objects
Version of the Day
|
Sparse Coordinate Matrix abstraction storage class. More...
#include <AbstractLinAlgPack_COOMatrixClass.hpp>
Public Member Functions | |
COOMatrix & | operator= (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... | |
{\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. | |
value_type * | val () |
Return pointer to raw storage array (length #nz()#) for the values of the non-zero elements. More... | |
const value_type * | val () const |
const value_type * | const_val () const |
indice_type * | ivect () |
const indice_type * | ivect () const |
const indice_type * | const_ivect () const |
indice_type * | jvect () |
Return pointer to raw storage array (length #nz()#) for the column indices of the non-zero elements. More... | |
const indice_type * | jvect () const |
const indice_type * | const_jvect () const |
void | initialize (std::istream &istrm) |
Initialize from an input stream. More... | |
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.
typedef AbstractLinAlgPack::size_type AbstractLinAlgPack::COOMatrix::size_type |
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.
typedef AbstractLinAlgPack::value_type AbstractLinAlgPack::COOMatrix::value_type |
Definition at line 76 of file AbstractLinAlgPack_COOMatrixClass.hpp.
|
inline |
Consturct with no storage allocated.
Definition at line 198 of file AbstractLinAlgPack_COOMatrixClass.hpp.
Assignment operator.
This function has similar behavior w.r.t sharing that the copy constructor has accept any current storage will be deallocated.
|
inline |
Return the number of rows in the row access view.
Definition at line 201 of file AbstractLinAlgPack_COOMatrixClass.hpp.
|
inline |
Returns the number of columns in the column access view.
Definition at line 204 of file AbstractLinAlgPack_COOMatrixClass.hpp.
|
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.
|
inline |
Definition at line 214 of file AbstractLinAlgPack_COOMatrixClass.hpp.
|
inline |
Definition at line 217 of file AbstractLinAlgPack_COOMatrixClass.hpp.
|
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.
|
inline |
Definition at line 223 of file AbstractLinAlgPack_COOMatrixClass.hpp.
|
inline |
Definition at line 226 of file AbstractLinAlgPack_COOMatrixClass.hpp.
|
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.
|
inline |
Definition at line 232 of file AbstractLinAlgPack_COOMatrixClass.hpp.
|
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.