Stokhos Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros 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>

Inherits iterator< std::bidirectional_iterator_tag, std::iterator_traits< index_iterator_type >::value_type, std::iterator_traits< index_iterator_type >::difference_type, std::iterator_traits< index_iterator_type >::pointer, std::iterator_traits< index_iterator_type >::reference >.

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

Protected Attributes

index_iterator_type index_iterator
 Index iterator. More...
 
value_iterator_type value_iterator
 Value iterator. More...
 

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.

Definition at line 24 of file Stokhos_SparseArray.hpp.

Member Typedef Documentation

template<typename index_iterator, typename value_iterator>
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 > Stokhos::SparseArrayIterator< index_iterator, value_iterator >::base_type

Definition at line 113 of file Stokhos_SparseArray.hpp.

template<typename index_iterator, typename value_iterator>
typedef base_type::iterator_category Stokhos::SparseArrayIterator< index_iterator, value_iterator >::iterator_category

Definition at line 114 of file Stokhos_SparseArray.hpp.

template<typename index_iterator, typename value_iterator>
typedef base_type::value_type Stokhos::SparseArrayIterator< index_iterator, value_iterator >::value_type

Definition at line 115 of file Stokhos_SparseArray.hpp.

template<typename index_iterator, typename value_iterator>
typedef base_type::difference_type Stokhos::SparseArrayIterator< index_iterator, value_iterator >::difference_type

Definition at line 116 of file Stokhos_SparseArray.hpp.

template<typename index_iterator, typename value_iterator>
typedef base_type::reference Stokhos::SparseArrayIterator< index_iterator, value_iterator >::reference

Definition at line 117 of file Stokhos_SparseArray.hpp.

template<typename index_iterator, typename value_iterator>
typedef base_type::pointer Stokhos::SparseArrayIterator< index_iterator, value_iterator >::pointer

Definition at line 118 of file Stokhos_SparseArray.hpp.

template<typename index_iterator, typename value_iterator>
typedef std::iterator_traits<value_iterator_type>::reference Stokhos::SparseArrayIterator< index_iterator, value_iterator >::value_reference

Definition at line 119 of file Stokhos_SparseArray.hpp.

Constructor & Destructor Documentation

template<typename index_iterator, typename value_iterator>
Stokhos::SparseArrayIterator< index_iterator, value_iterator >::SparseArrayIterator ( )
inline

Default constructor.

Definition at line 122 of file Stokhos_SparseArray.hpp.

template<typename index_iterator, typename value_iterator>
Stokhos::SparseArrayIterator< index_iterator, value_iterator >::SparseArrayIterator ( index_iterator_type  index_it,
value_iterator_type  value_it 
)
inline

Constructor.

Definition at line 125 of file Stokhos_SparseArray.hpp.

Member Function Documentation

template<typename index_iterator, typename value_iterator>
bool Stokhos::SparseArrayIterator< index_iterator, value_iterator >::operator== ( const SparseArrayIterator< index_iterator, value_iterator > &  it) const
inline

== operator

Definition at line 130 of file Stokhos_SparseArray.hpp.

template<typename index_iterator, typename value_iterator>
bool Stokhos::SparseArrayIterator< index_iterator, value_iterator >::operator!= ( const SparseArrayIterator< index_iterator, value_iterator > &  it) const
inline

!= operator

Definition at line 136 of file Stokhos_SparseArray.hpp.

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

Definition at line 143 of file Stokhos_SparseArray.hpp.

template<typename index_iterator, typename value_iterator>
pointer Stokhos::SparseArrayIterator< index_iterator, value_iterator >::operator-> ( ) const
inline

-> operator

Definition at line 149 of file Stokhos_SparseArray.hpp.

template<typename index_iterator, typename value_iterator>
SparseArrayIterator& Stokhos::SparseArrayIterator< index_iterator, value_iterator >::operator++ ( void  )
inline

Prefix ++.

Definition at line 154 of file Stokhos_SparseArray.hpp.

template<typename index_iterator, typename value_iterator>
SparseArrayIterator Stokhos::SparseArrayIterator< index_iterator, value_iterator >::operator++ ( int  )
inline

Postfix ++.

Definition at line 161 of file Stokhos_SparseArray.hpp.

template<typename index_iterator, typename value_iterator>
SparseArrayIterator& Stokhos::SparseArrayIterator< index_iterator, value_iterator >::operator-- ( )
inline

Prefix –.

Definition at line 168 of file Stokhos_SparseArray.hpp.

template<typename index_iterator, typename value_iterator>
SparseArrayIterator Stokhos::SparseArrayIterator< index_iterator, value_iterator >::operator-- ( int  )
inline

Postfix –.

Definition at line 175 of file Stokhos_SparseArray.hpp.

template<typename index_iterator, typename value_iterator>
bool Stokhos::SparseArrayIterator< index_iterator, value_iterator >::operator< ( const SparseArrayIterator< index_iterator, value_iterator > &  b) const
inline

Return true of *this < b.

Definition at line 182 of file Stokhos_SparseArray.hpp.

template<typename index_iterator, typename value_iterator>
value_reference Stokhos::SparseArrayIterator< index_iterator, value_iterator >::value ( ) const
inline

Return value associated with iterator.

Definition at line 188 of file Stokhos_SparseArray.hpp.

Member Data Documentation

template<typename index_iterator, typename value_iterator>
index_iterator_type Stokhos::SparseArrayIterator< index_iterator, value_iterator >::index_iterator
protected

Index iterator.

Definition at line 195 of file Stokhos_SparseArray.hpp.

template<typename index_iterator, typename value_iterator>
value_iterator_type Stokhos::SparseArrayIterator< index_iterator, value_iterator >::value_iterator
protected

Value iterator.

Definition at line 198 of file Stokhos_SparseArray.hpp.


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