Stokhos Development
Loading...
Searching...
No Matches
Stokhos::SparseArrayIterator< index_iterator_type, value_iterator_type > Class Template Reference

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

#include <Stokhos_SparseArray.hpp>

Inheritance diagram for Stokhos::SparseArrayIterator< index_iterator_type, value_iterator_type >:
Collaboration diagram for Stokhos::SparseArrayIterator< index_iterator_type, value_iterator_type >:

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_type, typename value_iterator_type>
class Stokhos::SparseArrayIterator< index_iterator_type, value_iterator_type >

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

◆ operator*()

template<typename index_iterator_type, typename value_iterator_type>
reference Stokhos::SparseArrayIterator< index_iterator_type, value_iterator_type >::operator* ( ) const
inline
  • operator

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