Stokhos  Development
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
Public Types | Public Member Functions | Protected Attributes | List of all members
Stokhos::SparseArrayIterator< index_iterator, value_iterator > Class Template Reference

Bi-directional iterator for traversing a sparse array. More...

#include <Stokhos_SparseArray.hpp>

Inheritance diagram for Stokhos::SparseArrayIterator< index_iterator, value_iterator >:
Inheritance graph
[legend]
Collaboration diagram for Stokhos::SparseArrayIterator< index_iterator, value_iterator >:
Collaboration graph
[legend]

Public Types

typedef std::iterator
< std::bidirectional_iterator_tag,
typename std::iterator_traits
< index_iterator_type >
::value_type, typename
std::iterator_traits
< index_iterator_type >
::difference_type, typename
std::iterator_traits
< index_iterator_type >
::pointer, typename
std::iterator_traits
< index_iterator_type >
::reference > 
base_type
 
typedef
base_type::iterator_category 
iterator_category
 
typedef base_type::value_type value_type
 
typedef base_type::difference_type difference_type
 
typedef base_type::reference reference
 
typedef base_type::pointer pointer
 
typedef std::iterator_traits
< value_iterator_type >
::reference 
value_reference
 

Public Member Functions

 SparseArrayIterator ()
 Default constructor.
 
 SparseArrayIterator (index_iterator_type index_it, value_iterator_type value_it)
 Constructor.
 
bool operator== (const SparseArrayIterator &it) const
 == operator
 
bool operator!= (const SparseArrayIterator &it) const
 != operator
 
reference operator* () const
 
pointer operator-> () const
 -> operator
 
SparseArrayIteratoroperator++ ()
 Prefix ++.
 
SparseArrayIterator operator++ (int)
 Postfix ++.
 
SparseArrayIteratoroperator-- ()
 Prefix –.
 
SparseArrayIterator operator-- (int)
 Postfix –.
 
bool operator< (const SparseArrayIterator &b) const
 Return true of *this < b.
 
value_reference value () const
 Return value associated with iterator.
 

Protected Attributes

index_iterator_type index_iterator
 Index iterator.
 
value_iterator_type value_iterator
 Value iterator.
 

Detailed Description

template<typename index_iterator, typename value_iterator>
class Stokhos::SparseArrayIterator< index_iterator, value_iterator >

Bi-directional iterator for traversing a sparse array.

The "value" of the iterator is the index, which is what you get from dereferencing the iterator (* or ->). There is also a method called value() that gives you the value of the sparse array pointed at by the iterator.

This could easily be a random access iterator. I just haven't implemented those methods.

Member Function Documentation

template<typename index_iterator, typename value_iterator>
reference Stokhos::SparseArrayIterator< index_iterator, value_iterator >::operator* ( ) const
inline

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