AXOM
Axom provides a robust, flexible software infrastructure for the development of multi-physics applications and computational tools.
axom::slam::BivariateMap< SetType, DataType, StridePolicy >::BivariateMapIterator Class Reference

An iterator type for a BivariateMap, iterating via its ElementFlatIndex. More...

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

Inheritance diagram for axom::slam::BivariateMap< SetType, DataType, StridePolicy >::BivariateMapIterator:

Public Types

using PositionType = SetPosition
 

Public Member Functions

 BivariateMapIterator (BivariateMap *sMap, PositionType pos)
 Construct a new BivariateMap Iterator given an ElementFlatIndex. More...
 
bool operator== (const iter &other) const
 
bool operator!= (const iter &other) const
 
DataType & operator* ()
 Returns the current iterator value. If the BivariateMap has multiple components, this will return the first component. To access the other components, use iter(comp) More...
 
DataType & operator() (PositionType comp_idx=0)
 Returns the iterator's value at the specified component. Returns the first component if comp_idx is not specified. More...
 
DataType & operator[] (PositionType n)
 Returns the first component value after n increments. More...
 
DataType & value (PositionType comp=0)
 Return the value at the iterator's position. Same as operator() More...
 
PositionType firstIndex ()
 return the current iterator's first index into the BivariateSet More...
 
PositionType secondIndex ()
 return the current iterator's second index (DenseIndex) into the BivariateSet More...
 
PositionType numComp () const
 Returns the number of components per element in the map. More...
 
Iterator advance and distance operators
BivariateMapIteratoroperator++ ()
 Pre-increment operator. More...
 
BivariateMapIterator operator++ (int)
 Post-increment operator. More...
 
BivariateMapIteratoroperator-- ()
 Pre-decrement operator. More...
 
BivariateMapIterator operator-- (int)
 Post-decrement operator. More...
 
BivariateMapIteratoroperator+= (SetPosition n)
 Addition-assignment operator. More...
 
BivariateMapIteratoroperator-= (SetPosition n)
 Subtraction-assignment operator. More...
 

Public Attributes

const PositionType INVALID_POS = -2
 

Protected Member Functions

void advance (PositionType n)
 

Protected Attributes

SetPosition m_pos
 

Detailed Description

template<typename SetType, typename DataType, typename StridePolicy = policies::StrideOne<typename SetType::PositionType>>
class axom::slam::BivariateMap< SetType, DataType, StridePolicy >::BivariateMapIterator

An iterator type for a BivariateMap, iterating via its ElementFlatIndex.

This iterator class traverses the BivariateMap using its ElementFlatIndex. In addition to m_pos from IteratorBase, this class also keeps track of the iterator's first index (firstIdx), second dense index (secondIdx), and the second sparse index (secondSparseIdx). The advance() function is implemented to update those three additional indices.

Member Typedef Documentation

◆ PositionType

template<typename SetType , typename DataType , typename StridePolicy = policies::StrideOne<typename SetType::PositionType>>
using axom::slam::BivariateMap< SetType, DataType, StridePolicy >::BivariateMapIterator::PositionType = SetPosition

Constructor & Destructor Documentation

◆ BivariateMapIterator()

template<typename SetType , typename DataType , typename StridePolicy = policies::StrideOne<typename SetType::PositionType>>
axom::slam::BivariateMap< SetType, DataType, StridePolicy >::BivariateMapIterator::BivariateMapIterator ( BivariateMap sMap,
PositionType  pos 
)
inline

Member Function Documentation

◆ operator==()

template<typename SetType , typename DataType , typename StridePolicy = policies::StrideOne<typename SetType::PositionType>>
bool axom::slam::BivariateMap< SetType, DataType, StridePolicy >::BivariateMapIterator::operator== ( const iter other) const
inline

◆ operator!=()

template<typename SetType , typename DataType , typename StridePolicy = policies::StrideOne<typename SetType::PositionType>>
bool axom::slam::BivariateMap< SetType, DataType, StridePolicy >::BivariateMapIterator::operator!= ( const iter other) const
inline

◆ operator*()

template<typename SetType , typename DataType , typename StridePolicy = policies::StrideOne<typename SetType::PositionType>>
DataType& axom::slam::BivariateMap< SetType, DataType, StridePolicy >::BivariateMapIterator::operator* ( )
inline

Returns the current iterator value. If the BivariateMap has multiple components, this will return the first component. To access the other components, use iter(comp)

◆ operator()()

template<typename SetType , typename DataType , typename StridePolicy = policies::StrideOne<typename SetType::PositionType>>
DataType& axom::slam::BivariateMap< SetType, DataType, StridePolicy >::BivariateMapIterator::operator() ( PositionType  comp_idx = 0)
inline

Returns the iterator's value at the specified component. Returns the first component if comp_idx is not specified.

Parameters
comp_idx(Optional) Zero-based index of the component.

◆ operator[]()

template<typename SetType , typename DataType , typename StridePolicy = policies::StrideOne<typename SetType::PositionType>>
DataType& axom::slam::BivariateMap< SetType, DataType, StridePolicy >::BivariateMapIterator::operator[] ( PositionType  n)
inline

Returns the first component value after n increments.

References axom::slam::IteratorBase< BivariateMapIterator, SetPosition >::operator+.

◆ value()

template<typename SetType , typename DataType , typename StridePolicy = policies::StrideOne<typename SetType::PositionType>>
DataType& axom::slam::BivariateMap< SetType, DataType, StridePolicy >::BivariateMapIterator::value ( PositionType  comp = 0)
inline

Return the value at the iterator's position. Same as operator()

◆ firstIndex()

template<typename SetType , typename DataType , typename StridePolicy = policies::StrideOne<typename SetType::PositionType>>
PositionType axom::slam::BivariateMap< SetType, DataType, StridePolicy >::BivariateMapIterator::firstIndex ( )
inline

return the current iterator's first index into the BivariateSet

◆ secondIndex()

template<typename SetType , typename DataType , typename StridePolicy = policies::StrideOne<typename SetType::PositionType>>
PositionType axom::slam::BivariateMap< SetType, DataType, StridePolicy >::BivariateMapIterator::secondIndex ( )
inline

◆ numComp()

◆ advance()

template<typename SetType , typename DataType , typename StridePolicy = policies::StrideOne<typename SetType::PositionType>>
void axom::slam::BivariateMap< SetType, DataType, StridePolicy >::BivariateMapIterator::advance ( PositionType  n)
inlineprotected

◆ operator++() [1/2]

Pre-increment operator.

◆ operator++() [2/2]

Post-increment operator.

◆ operator--() [1/2]

Pre-decrement operator.

◆ operator--() [2/2]

Post-decrement operator.

◆ operator+=()

BivariateMapIterator & axom::slam::IteratorBase< BivariateMapIterator , SetPosition >::operator+= ( SetPosition  n)
inlineinherited

Addition-assignment operator.

◆ operator-=()

BivariateMapIterator & axom::slam::IteratorBase< BivariateMapIterator , SetPosition >::operator-= ( SetPosition  n)
inlineinherited

Subtraction-assignment operator.

Member Data Documentation

◆ INVALID_POS

template<typename SetType , typename DataType , typename StridePolicy = policies::StrideOne<typename SetType::PositionType>>
const PositionType axom::slam::BivariateMap< SetType, DataType, StridePolicy >::BivariateMapIterator::INVALID_POS = -2

◆ m_pos


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