Stokhos Development
Loading...
Searching...
No Matches
Stokhos::TotalOrderIndexSet< ordinal_t >::Iterator Class Reference

Iterator class for iterating over elements of the index set. More...

#include <Stokhos_ProductBasisUtils.hpp>

Inheritance diagram for Stokhos::TotalOrderIndexSet< ordinal_t >::Iterator:
Collaboration diagram for Stokhos::TotalOrderIndexSet< ordinal_t >::Iterator:

Public Types

typedef std::iterator< std::input_iterator_tag, multiindex_type > 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 const multiindex_type & const_reference
typedef const multiindex_type * const_pointer

Public Member Functions

 Iterator (ordinal_type max_order_, const multiindex_type &index_)
 Constructor.
bool operator== (const Iterator &it) const
 Compare equality of iterators.
bool operator!= (const Iterator &it) const
 Compare inequality of iterators.
const_reference operator* () const
 Dereference.
const_pointer operator-> () const
 Dereference.
Iteratoroperator++ ()
 Prefix increment, i.e., ++iterator.
Iteratoroperator++ (int)
 Postfix increment, i.e., iterator++.

Protected Attributes

ordinal_type max_order
 Maximum order of iterator.
multiindex_type index
 Current value of iterator.
ordinal_type dim
 Dimension.
Teuchos::Array< ordinal_type > orders
 Maximum orders for each term to determine how to increment.

Detailed Description

template<typename ordinal_t>
class Stokhos::TotalOrderIndexSet< ordinal_t >::Iterator

Iterator class for iterating over elements of the index set.

Constructor & Destructor Documentation

◆ Iterator()

template<typename ordinal_t>
Stokhos::TotalOrderIndexSet< ordinal_t >::Iterator::Iterator ( ordinal_type max_order_,
const multiindex_type & index_ )
inline

Constructor.

max_order_ is the maximum order of the set (inclusive) and index_ is the starting multi-index.

References dim, Stokhos::TotalOrderIndexSet< ordinal_t >::dimension(), index, max_order, and orders.

Referenced by Stokhos::TotalOrderIndexSet< ordinal_t >::begin(), Stokhos::TotalOrderIndexSet< ordinal_t >::end(), operator!=(), operator++(), operator++(), and operator==().

Member Function Documentation

◆ operator!=()

template<typename ordinal_t>
bool Stokhos::TotalOrderIndexSet< ordinal_t >::Iterator::operator!= ( const Iterator & it) const
inline

Compare inequality of iterators.

References index, and Iterator().

◆ operator*()

template<typename ordinal_t>
const_reference Stokhos::TotalOrderIndexSet< ordinal_t >::Iterator::operator* ( ) const
inline

Dereference.

References index.

◆ operator++() [1/2]

template<typename ordinal_t>
Iterator & Stokhos::TotalOrderIndexSet< ordinal_t >::Iterator::operator++ ( )
inline

Prefix increment, i.e., ++iterator.

No particular ordering of the indices is guaranteed. The current implementation produces multi-indices sorted lexographically backwards among the elements, e.g., [0 0], [1 0], [2 0], ... [0 1], [1 1], [2 1], ... but one shouldn't assume that. To obtain a specific ordering, one should implement a "less" functional and put the indices in a sorted container such as std::map<>.

References dim, index, Iterator(), and orders.

◆ operator++() [2/2]

template<typename ordinal_t>
Iterator & Stokhos::TotalOrderIndexSet< ordinal_t >::Iterator::operator++ ( int )
inline

Postfix increment, i.e., iterator++.

References Iterator().

◆ operator->()

template<typename ordinal_t>
const_pointer Stokhos::TotalOrderIndexSet< ordinal_t >::Iterator::operator-> ( ) const
inline

Dereference.

References index.

◆ operator==()

template<typename ordinal_t>
bool Stokhos::TotalOrderIndexSet< ordinal_t >::Iterator::operator== ( const Iterator & it) const
inline

Compare equality of iterators.

References index, and Iterator().

Member Data Documentation

◆ dim

template<typename ordinal_t>
ordinal_type Stokhos::TotalOrderIndexSet< ordinal_t >::Iterator::dim
protected

Dimension.

Referenced by Iterator(), and operator++().

◆ index

template<typename ordinal_t>
multiindex_type Stokhos::TotalOrderIndexSet< ordinal_t >::Iterator::index
protected

Current value of iterator.

Referenced by Iterator(), operator!=(), operator*(), operator++(), operator->(), and operator==().

◆ max_order

template<typename ordinal_t>
ordinal_type Stokhos::TotalOrderIndexSet< ordinal_t >::Iterator::max_order
protected

Maximum order of iterator.

Referenced by Iterator().

◆ orders

template<typename ordinal_t>
Teuchos::Array<ordinal_type> Stokhos::TotalOrderIndexSet< ordinal_t >::Iterator::orders
protected

Maximum orders for each term to determine how to increment.

Referenced by Iterator(), and operator++().


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