AXOM
Axom provides a robust, flexible software infrastructure for the development of multi-physics applications and computational tools.
axom::slam::BivariateMap< T, BSet, IndPol, StrPol, IfacePol >::RangeIterator< Const > Class Template Reference

An iterator type for a BivariateMap, iterating over elements in an associated BivariateSet. More...

#include </home/docs/checkouts/readthedocs.org/user_builds/axom/checkouts/latest/src/axom/slam/BivariateMap.hpp>

Inheritance diagram for axom::slam::BivariateMap< T, BSet, IndPol, StrPol, IfacePol >::RangeIterator< Const >:

Public Types

using IterBase = IteratorBase< RangeIterator< Const >, SetPosition >
 
using MapIterator = typename MapType::template MapRangeIterator< Const >
 
using iterator_category = std::random_access_iterator_tag
 
using value_type = typename MapIterator::value_type
 
using reference = typename MapIterator::reference
 
using pointer = typename MapIterator::pointer
 
using difference_type = SetPosition
 
using DataRefType = typename MapIterator::DataRefType
 
using BivariateMapPtr = std::conditional_t< Const, const BivariateMap *, BivariateMap * >
 
using PositionType = SetPosition
 
Equality and relational operators
using iterator = IteratorBase< RangeIterator< Const >, SetPosition >
 

Public Member Functions

 RangeIterator (BivariateMapPtr sMap, PositionType pos)
 Construct a new BivariateMap Iterator given an ElementFlatIndex. More...
 
AXOM_HOST_DEVICE reference operator* () const
 Returns the range of elements pointed to by this iterator. More...
 
AXOM_HOST_DEVICE pointer operator-> () const
 
template<typename... ComponentIndex>
AXOM_HOST_DEVICE DataRefType operator() (ComponentIndex... comp_idx) const
 Returns the iterator's value at the given component index. More...
 
DataRefType operator[] (PositionType n) const
 Returns the first component value after n increments.
More...
 
template<typename... ComponentIndex>
DataRefType value (ComponentIndex... comp) const
 Return the value at the iterator's position for a given component index. Same as operator() More...
 
PositionType firstIndex () const
 return the current iterator's first index into the BivariateSet More...
 
PositionType secondIndex () const
 return the current iterator's second index (DenseIndex) into the BivariateSet More...
 
PositionType flatIndex () const
 Return the current iterator's flat bivariate index. More...
 
PositionType numComp () const
 Returns the number of components per element in the map. More...
 
Iterator advance and distance operators
AXOM_HOST_DEVICE RangeIterator< Const > & operator++ ()
 Pre-increment operator. More...
 
RangeIterator< Const > operator++ (int)
 Post-increment operator. More...
 
RangeIterator< Const > & operator-- ()
 Pre-decrement operator. More...
 
RangeIterator< Const > operator-- (int)
 Post-decrement operator. More...
 
RangeIterator< Const > & operator+= (SetPosition n)
 Addition-assignment operator. More...
 
RangeIterator< Const > & operator-= (SetPosition n)
 Subtraction-assignment operator. More...
 

Static Public Attributes

static constexpr PositionType INVALID_POS = -2
 

Protected Member Functions

AXOM_HOST_DEVICE void advance (IndexType n)
 

Protected Attributes

SetPosition m_pos
 

Detailed Description

template<typename T, typename BSet = BivariateSet<>, typename IndPol = policies::STLVectorIndirection<typename BSet::PositionType, T>, typename StrPol = policies::StrideOne<typename BSet::PositionType>, typename IfacePol = policies::VirtualInterface>
template<bool Const>
class axom::slam::BivariateMap< T, BSet, IndPol, StrPol, IfacePol >::RangeIterator< Const >

An iterator type for a BivariateMap, iterating over elements in an associated BivariateSet.

Unlike the FlatIterator, which iterates over all map elements, the RangeIterator may point to a range of elements in the case of non-unit stride.

Member Typedef Documentation

◆ IterBase

template<typename T , typename BSet = BivariateSet<>, typename IndPol = policies::STLVectorIndirection<typename BSet::PositionType, T>, typename StrPol = policies::StrideOne<typename BSet::PositionType>, typename IfacePol = policies::VirtualInterface>
template<bool Const>
using axom::slam::BivariateMap< T, BSet, IndPol, StrPol, IfacePol >::RangeIterator< Const >::IterBase = IteratorBase<RangeIterator<Const>, SetPosition>

◆ MapIterator

template<typename T , typename BSet = BivariateSet<>, typename IndPol = policies::STLVectorIndirection<typename BSet::PositionType, T>, typename StrPol = policies::StrideOne<typename BSet::PositionType>, typename IfacePol = policies::VirtualInterface>
template<bool Const>
using axom::slam::BivariateMap< T, BSet, IndPol, StrPol, IfacePol >::RangeIterator< Const >::MapIterator = typename MapType::template MapRangeIterator<Const>

◆ iterator_category

template<typename T , typename BSet = BivariateSet<>, typename IndPol = policies::STLVectorIndirection<typename BSet::PositionType, T>, typename StrPol = policies::StrideOne<typename BSet::PositionType>, typename IfacePol = policies::VirtualInterface>
template<bool Const>
using axom::slam::BivariateMap< T, BSet, IndPol, StrPol, IfacePol >::RangeIterator< Const >::iterator_category = std::random_access_iterator_tag

◆ value_type

template<typename T , typename BSet = BivariateSet<>, typename IndPol = policies::STLVectorIndirection<typename BSet::PositionType, T>, typename StrPol = policies::StrideOne<typename BSet::PositionType>, typename IfacePol = policies::VirtualInterface>
template<bool Const>
using axom::slam::BivariateMap< T, BSet, IndPol, StrPol, IfacePol >::RangeIterator< Const >::value_type = typename MapIterator::value_type

◆ reference

template<typename T , typename BSet = BivariateSet<>, typename IndPol = policies::STLVectorIndirection<typename BSet::PositionType, T>, typename StrPol = policies::StrideOne<typename BSet::PositionType>, typename IfacePol = policies::VirtualInterface>
template<bool Const>
using axom::slam::BivariateMap< T, BSet, IndPol, StrPol, IfacePol >::RangeIterator< Const >::reference = typename MapIterator::reference

◆ pointer

template<typename T , typename BSet = BivariateSet<>, typename IndPol = policies::STLVectorIndirection<typename BSet::PositionType, T>, typename StrPol = policies::StrideOne<typename BSet::PositionType>, typename IfacePol = policies::VirtualInterface>
template<bool Const>
using axom::slam::BivariateMap< T, BSet, IndPol, StrPol, IfacePol >::RangeIterator< Const >::pointer = typename MapIterator::pointer

◆ difference_type

template<typename T , typename BSet = BivariateSet<>, typename IndPol = policies::STLVectorIndirection<typename BSet::PositionType, T>, typename StrPol = policies::StrideOne<typename BSet::PositionType>, typename IfacePol = policies::VirtualInterface>
template<bool Const>
using axom::slam::BivariateMap< T, BSet, IndPol, StrPol, IfacePol >::RangeIterator< Const >::difference_type = SetPosition

◆ DataRefType

template<typename T , typename BSet = BivariateSet<>, typename IndPol = policies::STLVectorIndirection<typename BSet::PositionType, T>, typename StrPol = policies::StrideOne<typename BSet::PositionType>, typename IfacePol = policies::VirtualInterface>
template<bool Const>
using axom::slam::BivariateMap< T, BSet, IndPol, StrPol, IfacePol >::RangeIterator< Const >::DataRefType = typename MapIterator::DataRefType

◆ BivariateMapPtr

template<typename T , typename BSet = BivariateSet<>, typename IndPol = policies::STLVectorIndirection<typename BSet::PositionType, T>, typename StrPol = policies::StrideOne<typename BSet::PositionType>, typename IfacePol = policies::VirtualInterface>
template<bool Const>
using axom::slam::BivariateMap< T, BSet, IndPol, StrPol, IfacePol >::RangeIterator< Const >::BivariateMapPtr = std::conditional_t<Const, const BivariateMap*, BivariateMap*>

◆ PositionType

template<typename T , typename BSet = BivariateSet<>, typename IndPol = policies::STLVectorIndirection<typename BSet::PositionType, T>, typename StrPol = policies::StrideOne<typename BSet::PositionType>, typename IfacePol = policies::VirtualInterface>
template<bool Const>
using axom::slam::BivariateMap< T, BSet, IndPol, StrPol, IfacePol >::RangeIterator< Const >::PositionType = SetPosition

◆ iterator

Constructor & Destructor Documentation

◆ RangeIterator()

template<typename T , typename BSet = BivariateSet<>, typename IndPol = policies::STLVectorIndirection<typename BSet::PositionType, T>, typename StrPol = policies::StrideOne<typename BSet::PositionType>, typename IfacePol = policies::VirtualInterface>
template<bool Const>
axom::slam::BivariateMap< T, BSet, IndPol, StrPol, IfacePol >::RangeIterator< Const >::RangeIterator ( BivariateMapPtr  sMap,
PositionType  pos 
)
inline

Construct a new BivariateMap Iterator given an ElementFlatIndex.

Member Function Documentation

◆ operator*()

template<typename T , typename BSet = BivariateSet<>, typename IndPol = policies::STLVectorIndirection<typename BSet::PositionType, T>, typename StrPol = policies::StrideOne<typename BSet::PositionType>, typename IfacePol = policies::VirtualInterface>
template<bool Const>
AXOM_HOST_DEVICE reference axom::slam::BivariateMap< T, BSet, IndPol, StrPol, IfacePol >::RangeIterator< Const >::operator* ( ) const
inline

Returns the range of elements pointed to by this iterator.

◆ operator->()

template<typename T , typename BSet = BivariateSet<>, typename IndPol = policies::STLVectorIndirection<typename BSet::PositionType, T>, typename StrPol = policies::StrideOne<typename BSet::PositionType>, typename IfacePol = policies::VirtualInterface>
template<bool Const>
AXOM_HOST_DEVICE pointer axom::slam::BivariateMap< T, BSet, IndPol, StrPol, IfacePol >::RangeIterator< Const >::operator-> ( ) const
inline

◆ operator()()

template<typename T , typename BSet = BivariateSet<>, typename IndPol = policies::STLVectorIndirection<typename BSet::PositionType, T>, typename StrPol = policies::StrideOne<typename BSet::PositionType>, typename IfacePol = policies::VirtualInterface>
template<bool Const>
template<typename... ComponentIndex>
AXOM_HOST_DEVICE DataRefType axom::slam::BivariateMap< T, BSet, IndPol, StrPol, IfacePol >::RangeIterator< Const >::operator() ( ComponentIndex...  comp_idx) const
inline

Returns the iterator's value at the given component index.

Precondition
sizeof(compIdx) == StridePolicy::NumDims
0 <= compIdx[idim] < shape()[idim]

◆ operator[]()

template<typename T , typename BSet = BivariateSet<>, typename IndPol = policies::STLVectorIndirection<typename BSet::PositionType, T>, typename StrPol = policies::StrideOne<typename BSet::PositionType>, typename IfacePol = policies::VirtualInterface>
template<bool Const>
DataRefType axom::slam::BivariateMap< T, BSet, IndPol, StrPol, IfacePol >::RangeIterator< Const >::operator[] ( PositionType  n) const
inline

Returns the first component value after n increments.

References axom::slam::operator+().

◆ value()

template<typename T , typename BSet = BivariateSet<>, typename IndPol = policies::STLVectorIndirection<typename BSet::PositionType, T>, typename StrPol = policies::StrideOne<typename BSet::PositionType>, typename IfacePol = policies::VirtualInterface>
template<bool Const>
template<typename... ComponentIndex>
DataRefType axom::slam::BivariateMap< T, BSet, IndPol, StrPol, IfacePol >::RangeIterator< Const >::value ( ComponentIndex...  comp) const
inline

Return the value at the iterator's position for a given component index. Same as operator()

◆ firstIndex()

template<typename T , typename BSet = BivariateSet<>, typename IndPol = policies::STLVectorIndirection<typename BSet::PositionType, T>, typename StrPol = policies::StrideOne<typename BSet::PositionType>, typename IfacePol = policies::VirtualInterface>
template<bool Const>
PositionType axom::slam::BivariateMap< T, BSet, IndPol, StrPol, IfacePol >::RangeIterator< Const >::firstIndex ( ) const
inline

return the current iterator's first index into the BivariateSet

◆ secondIndex()

template<typename T , typename BSet = BivariateSet<>, typename IndPol = policies::STLVectorIndirection<typename BSet::PositionType, T>, typename StrPol = policies::StrideOne<typename BSet::PositionType>, typename IfacePol = policies::VirtualInterface>
template<bool Const>
PositionType axom::slam::BivariateMap< T, BSet, IndPol, StrPol, IfacePol >::RangeIterator< Const >::secondIndex ( ) const
inline

return the current iterator's second index (DenseIndex) into the BivariateSet

◆ flatIndex()

template<typename T , typename BSet = BivariateSet<>, typename IndPol = policies::STLVectorIndirection<typename BSet::PositionType, T>, typename StrPol = policies::StrideOne<typename BSet::PositionType>, typename IfacePol = policies::VirtualInterface>
template<bool Const>
PositionType axom::slam::BivariateMap< T, BSet, IndPol, StrPol, IfacePol >::RangeIterator< Const >::flatIndex ( ) const
inline

Return the current iterator's flat bivariate index.

◆ numComp()

template<typename T , typename BSet = BivariateSet<>, typename IndPol = policies::STLVectorIndirection<typename BSet::PositionType, T>, typename StrPol = policies::StrideOne<typename BSet::PositionType>, typename IfacePol = policies::VirtualInterface>
template<bool Const>
PositionType axom::slam::BivariateMap< T, BSet, IndPol, StrPol, IfacePol >::RangeIterator< Const >::numComp ( ) const
inline

Returns the number of components per element in the map.

References axom::slam::Map< T, S, IndPol, StrPol, IfacePol >::numComp().

◆ advance()

template<typename T , typename BSet = BivariateSet<>, typename IndPol = policies::STLVectorIndirection<typename BSet::PositionType, T>, typename StrPol = policies::StrideOne<typename BSet::PositionType>, typename IfacePol = policies::VirtualInterface>
template<bool Const>
AXOM_HOST_DEVICE void axom::slam::BivariateMap< T, BSet, IndPol, StrPol, IfacePol >::RangeIterator< Const >::advance ( IndexType  n)
inlineprotected

◆ operator++() [1/2]

AXOM_HOST_DEVICE RangeIterator< Const > & axom::IteratorBase< RangeIterator< Const > , SetPosition >::operator++ ( )
inlineinherited

Pre-increment operator.

◆ operator++() [2/2]

RangeIterator< Const > axom::IteratorBase< RangeIterator< Const > , SetPosition >::operator++ ( int  )
inlineinherited

Post-increment operator.

◆ operator--() [1/2]

RangeIterator< Const > & axom::IteratorBase< RangeIterator< Const > , SetPosition >::operator-- ( )
inlineinherited

Pre-decrement operator.

◆ operator--() [2/2]

RangeIterator< Const > axom::IteratorBase< RangeIterator< Const > , SetPosition >::operator-- ( int  )
inlineinherited

Post-decrement operator.

◆ operator+=()

RangeIterator< Const > & axom::IteratorBase< RangeIterator< Const > , SetPosition >::operator+= ( SetPosition  n)
inlineinherited

Addition-assignment operator.

◆ operator-=()

RangeIterator< Const > & axom::IteratorBase< RangeIterator< Const > , SetPosition >::operator-= ( SetPosition  n)
inlineinherited

Subtraction-assignment operator.

Member Data Documentation

◆ INVALID_POS

template<typename T , typename BSet = BivariateSet<>, typename IndPol = policies::STLVectorIndirection<typename BSet::PositionType, T>, typename StrPol = policies::StrideOne<typename BSet::PositionType>, typename IfacePol = policies::VirtualInterface>
template<bool Const>
constexpr PositionType axom::slam::BivariateMap< T, BSet, IndPol, StrPol, IfacePol >::RangeIterator< Const >::INVALID_POS = -2
staticconstexpr

◆ m_pos

SetPosition axom::IteratorBase< RangeIterator< Const > , SetPosition >::m_pos
protectedinherited

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