generic_comp2D<ValsType, ValPtr, IndType, IndPtr, int IND_OFFSET> [MTL Home] Programmers Guide
  Contents | Index |  Search 


Category:containers Component type:type
Description
The compressed2D container uses the compressed row/column storage format. There is an array of matrix elements, an array of indices, and an array of pointers to the row or column vector starts. A compressed2D matrix can be created from scratch with the constructor:
   compressed2D(size_type m, size_type n)
   
One can also use preexsisting arrays with the constructor:
   compressed2D(size_type m, size_type n, size_type nnz,
                T* val, size_type* ptr, size_type* ind)
   
The stored indices (in the ptr and int arrays) are indexed from 1 ala LAPACK and BLAS conventions (Fortran style). internal compiler errors
Example
In sparse_matrix.h:

Definition
compressed2D.h
Template Parameters

ParameterDescriptionDefault
ValsTypeThe container type to use for the values array 
ValPtrA pointer to the ValsType 
IndTypeThe container type to use for the indices and pointer arrays 
IndPtrA pointer to IndType 
IND_OFFSETTo handle indexing from 0 or 1 
Model of
TwoDContainerRef
Members
Member Where defined Description
self    
values_t    
TT    
value_iterator    
const_value_iterator    
indices_t    
index_iterator    
const_index_iterator    
starts_t    
starts_iterator    
const_starts_iterator    
size_type    
dim_type    
storage_loc    
enum { M = 0, N = 0 }    
class vec_ref   This vector reference is created on-the-fly as needed.
value_type   The 1D container type
reference   A reference to the value type
const_reference   A const reference to the value type
MajorVector    
MajorVectorRef    
ConstMajorVectorRef    
sparsity   Specify that this matrix is sparse
strideability   Specify that this matrix is not strideable (can not use rows(A), columns(A))
transpose_type    
submatrix_type    
banded_view_type    
template <int isConst>
class _iterator
  The type for the iterators
class iterator   The type for the iterators
class const_iterator   The type for the iterators
class iterator   The type for the iterators
class const_iterator   The type for the iterators
reverse_iterator   The type for the reverse iterators
const_reverse_iterator   The type for the const reverse iterators
generic_comp2D ()   Default Constructor
generic_comp2D (dim_type d, ValPtr v, IndPtr ind, IndPtr s)   External Storage Constructor
generic_comp2D (const self& x)   Copy Constructor
self& operator= (const self& x)    
iterator begin ()   Return an iterator pointing to the first 1D container
iterator end ()   Return an iterator pointing past the end of the 2D container
const_iterator begin () const   Return a const iterator pointing to the first 1D container
const_iterator end () const   Return a const iterator pointing past the end of the 2D container
reverse_iterator rbegin ()   Return a reverse iterator pointing to the last 1D container
reverse_iterator rend ()   Return a reverse iterator pointing past the start of the 2D container
const_reverse_iterator rbegin () const   Return a const reverse iterator pointing to the last 1D container
const_reverse_iterator rend () const   Return a const reverse iterator pointing past the start of the 2D container
reference::reference operator() (size_type i, size_type j)   Return a reference to the (i,j) element, where (i,j) is in the 2D coordinate system
const_reference:: const_reference operator() (size_type i, size_type j) const   Return a const reference to the (i,j) element, where (i,j) is in the 2D coordinate system
size_type major () const   The dimension of the 2D container
size_type minor () const   The dimension of the 1D containers
size_type nnz () const   The number of non-zeros
value_type operator[] (size_type i) const   Return the ith 1D container
TT* get_val ()   Return a pointer to the values array
const TT* get_val () const    
size_type* get_ind ()   Return a pointer to the indices array
const size_type* get_ind () const    
size_type* get_ptr ()   Return a pointer to the pointers array
const size_type* get_ptr () const    
template <class SparseMat>
void fast_copy (const SparseMat& x, sparse_tag)
  A fast specialization for copying from a sparse matrix
template <class DenseMat>
void fast_copy (const DenseMat x, dense_tag)
  A fast specialization for copying from a dense matrix
template <class TwoD__>
void fast_copy (const TwoD__& x)
   
void print () const    
New members
Notes
See also

[MTL Home] Copyright © 1998,1999 University of Notre Dame. All Rights Reserved.