Main Page   Namespace List   Compound List   File List   Namespace Members   Compound Members   File Members  

TNT::Sparse_Matrix_CompRow Class Template Reference

#include <tnt_sparse_matrix_csr.h>

List of all members.

Public Methods

 Sparse_Matrix_CompRow (const Sparse_Matrix_CompRow &S)
 Sparse_Matrix_CompRow (int M, int N, int nz, const T *val, const int *r, const int *c)
const T& val (int i) const
const int& row_ptr (int i) const
const int& col_ind (int i) const
int dim1 () const
int dim2 () const
int NumNonzeros () const
Sparse_Matrix_CompRow& operator= (const Sparse_Matrix_CompRow &R)


Detailed Description

template<class T> class TNT::Sparse_Matrix_CompRow

Read-only view of a sparse matrix in compressed-row storage format. Neither array elements (nonzeros) nor sparsity structure can be modified. If modifications are required, create a new view.

Index values begin at 0.

Storage requirements: An (m x n) matrix with nz nonzeros requires no more than ((T+I)*nz + M*I) bytes, where T is the size of data elements and I is the size of integers.


Constructor & Destructor Documentation

template<class T>
TNT::Sparse_Matrix_CompRow<T>::Sparse_Matrix_CompRow<T> ( const Sparse_Matrix_CompRow<T> & S )
 

template<class T>
TNT::Sparse_Matrix_CompRow< T >::Sparse_Matrix_CompRow<T> ( int M,
int N,
int nz,
const T * val,
const int * r,
const int * c )
 

Construct a read-only view of existing sparse matrix in compressed-row storage format.

Parameters:
M   the number of rows of sparse matrix
N   the number of columns of sparse matrix
nz   the number of nonzeros
val   a contiguous list of nonzero values
r   row-pointers: r[i] denotes the begining position of row i (i.e. the ith row begins at val[row[i]]).
c   column-indices: c[i] denotes the column location of val[i]


Member Function Documentation

template<class T>
int TNT::Sparse_Matrix_CompRow<T>::NumNonzeros ( ) const
 

template<class T>
const int & TNT::Sparse_Matrix_CompRow<T>::col_ind ( int i ) const [inline]
 

template<class T>
int TNT::Sparse_Matrix_CompRow<T>::dim1 ( ) const [inline]
 

template<class T>
int TNT::Sparse_Matrix_CompRow<T>::dim2 ( ) const [inline]
 

template<class T>
Sparse_Matrix_CompRow<T>& TNT::Sparse_Matrix_CompRow<T>::operator= ( const Sparse_Matrix_CompRow<T> & R )
 

template<class T>
const int & TNT::Sparse_Matrix_CompRow<T>::row_ptr ( int i ) const [inline]
 

template<class T>
const T & TNT::Sparse_Matrix_CompRow<T>::val ( int i ) const [inline]
 


The documentation for this class was generated from the following file:
Generated at Thu Jun 26 17:26:25 2003 for Template Numerical Toolkit (TNT) by doxygen1.2.5 written by Dimitri van Heesch, © 1997-2001