generic_dense2D<RepType, RepPtr, OffsetGen, int MM, int NN> [MTL Home] Programmers Guide
  Contents | Index |  Search 


Category:containers Component type:type
Description
The generic_dense2D container implements sevaral of the MTL storage types. They include dense, packed, banded, and banded_view. The common theme here is that the matrix is stored in a contiguous piece of memory. The differences in these storage types has to do with where to find the OneD segements in the linear memory. Caclulating these offsets is the job of the Offset concept, which has a model to handle each of the different storage types: rect_offset, strided_offset, banded_offset, packed_offset, and banded_view_offset. There are two derived classes of generic_dense2D that specify the memory management, dense2D and external2D. The dense2D version owns its memory, while the external2D imports its memory from somewhere else through a pointer (which allows for interoperability with other codes -- even with Fortran!).

JGS Nasty VC workaround VC doesn't like this friend class transpose_type;

Example
Definition
dense2D.h
Template Parameters

ParameterDescriptionDefault
RepTypeThe Container used to store the elements 
RepPtrThe type used to reference to the container 
OffsetGenThe generator that creates the Offset class 
MMFor static sized matrix, the major dimension 
NNFor static sized matrix, the minor dimension 
Model of
TwoDStorage
Members
Member Where defined Description
enum { M = MM, N = NN }   Static sizes (0 if dynamic)
size_type   The type for dimensions and indices
difference_type   The type for differences between iterators
dim_type   A pair type for dimensions
band_type   A pair type for bandwidth
sparsity   This is a dense matrix
is_strided    
value_type   The 1D container type
reference   The type for a reference to value_type
const_reference   The type for a const reference to value_type
iterator   The iterator type
const_iterator   The const iterator type
reverse_iterator   The reverse iterator type
const_reverse_iterator   The const reverse iterator type
transpose_type   The type for the transpose of this container
banded_view_type   The type for a banded view of this container
submatrix_type   The type for a sub-section of this 2D container
strideability   This is a stridable container, can use rows(A), columns(A)
generic_dense2D ()   Default Constructor
generic_dense2D (rep_ptr data, size_type m, size_type n, size_type ld)   Normal Constructor
generic_dense2D (rep_ptr data, size_type m, size_type n, size_type ld, dyn_dim s, char)   Constructor with non-zero upper-left corner indices
generic_dense2D (rep_ptr data, size_type ld)   Static M, N constructor
generic_dense2D (rep_ptr data, size_type m, size_type n, size_type ld, band_type bw)   with bandwidth constructor
generic_dense2D (const generic_dense2D& x)   Static M, N with bandwith?Copy Constructor
generic_dense2D& operator= (const generic_dense2D& x)   Assignment Operator
generic_dense2D (rep_ptr d, const generic_dense2D& x)   Subclass Constructor
generic_dense2D (const transpose_type& x, do_transpose, do_transpose)   Transpose Constructor
template <class MatrixStream, class Orien>
generic_dense2D (rep_ptr data, MatrixStream& s, Orien)
  Matrix Stream Constructor
template <class MatrixStream, class Orien>
generic_dense2D (rep_ptr data, MatrixStream& s, Orien, band_type bw)
  Banded Matrix Stream Constructor
template <class TwoD>
generic_dense2D (const TwoD& x, band_type bw, banded_tag)
  Banded View Constructor
~generic_dense2D ()   The destructor.
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
const elt_type& operator() (size_type i, size_type j) const   Return a reference to the (i,j) element, where (i,j) is in the 2D coordinate system
elt_type& operator() (size_type i, size_type j)   Return a const reference to the (i,j) element, where (i,j) is in the 2D coordinate system
size_type nnz () const   Number of non-zeroes
size_type capacity () const   Capacity
size_type major () const   Major axis size
size_type minor () const   Minor axis size
size_type ld () const   Leading Dimension
const elt_type* data () const   Memory Access
elt_type* data ()    
OneD bracket (size_type i, strided_tag) const   Implements the operator[]
OneD bracket (size_type i, not_strided_tag) const   Implements the operator[]
OneD operator[] (size_type i) const   OneD Access
size_type ld_    
rep_ptr data_    
pair_type starts    
Offset offset    
New members
Notes
See also

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