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

The SubMap class provides an API to easily traverse a subset of a Map. More...

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

Inheritance diagram for axom::slam::SubMap< SetType, DataType, SuperMapType, StridePolicy >:

Classes

class  SubMapIterator
 An iterator for SubMap, based on MapIterator. More...
 

Public Types

using IndexType = SetPosition
 
using SubsetType = OrderedSet< SetPosition, SetElement, policies::RuntimeSize< SetPosition >, policies::ZeroOffset< SetPosition >, policies::StrideOne< SetPosition >, policies::STLVectorIndirection< SetPosition, SetElement > >
 
using SubsetBuilder = typename SubsetType::SetBuilder
 
using const_iterator = SubMapIterator
 
using const_iterator_pair = std::pair< const_iterator, const_iterator >
 
using iterator = const_iterator
 
using iterator_pair = const_iterator_pair
 

Public Member Functions

 SubMap ()
 
 SubMap (const SuperMapType *supermap, SetType &subset_idx)
 Constructor for SubMap given the ElementFlatIndex into the SuperMap. More...
 
 SubMap (SuperMapType *supermap, SetType &subset_idx)
 
 SubMap (const SubMap &otherMap)
 
SubMapoperator= (const SubMap &otherMap)
 
 SubMap (SubMap &&otherMap)
 
SubMapoperator= (SubMap &&otherMap)
 
bool isValid (bool VerboseOutput=false) const override
 Checks whether the Map is valid. More...
 
SubMapIterator begin ()
 
SubMapIterator end ()
 
SubMap individual access functions
const DataType & operator[] (IndexType idx) const
 Access the value in the SubMap given the ComponentFlatIndex. More...
 
DataType & operator[] (IndexType idx)
 
const DataType & operator() (IndexType idx, IndexType comp=0) const
 Access the value associated with the given position in the subset and the component index. More...
 
DataType & operator() (IndexType idx, IndexType comp=0)
 
const DataType & value (IndexType idx, IndexType comp=0) const
 Access the value associated with the given position in the subset and the component index. More...
 
DataType & value (IndexType idx, IndexType comp=0)
 
IndexType index (IndexType idx) const
 Return the set element in the SuperMap at the given subset index. More...
 
SubMap cardinality functions
IndexType size () const override
 returns the size of the SubMap More...
 
IndexType numComp () const
 returns the number of components (aka. stride) of the SubMap More...
 

Protected Attributes

const SuperMapType * m_superMap_constptr
 
SuperMapType * m_superMap_ptr
 
std::vector< IndexTypem_subsetIdx_data
 
SubsetType m_subsetIdx
 

Detailed Description

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

The SubMap class provides an API to easily traverse a subset of a Map.

A SubMap is defined by a subset of the indices into a Map, which we refer to as its SuperMap (of type SuperMapType). The indices are expressed as ElementFlatIndex.
Please see BivariateMap for an explanation of the various indexing schemes.

SubMap is used by BivariateMap to return a set of values mapped to each item in its first set.

Template Parameters
SetTypedefines the Position and Element types of the underlying set
DataTypethe data type of the SuperMap
SuperMapTypethe type of SuperMap
StridePolicythe stride of SuperMap
Warning
SubMap constructor can take a const Map pointer or a non-const Map pointer. A non-const value access function in SubMap will fail if the Submap is constructed using a const Map pointer.
See also
Map, BivariateMap

Member Typedef Documentation

◆ IndexType

template<typename SetType , typename DataType , typename SuperMapType , typename StridePolicy = policies::StrideOne<typename SetType::PositionType>>
using axom::slam::SubMap< SetType, DataType, SuperMapType, StridePolicy >::IndexType = SetPosition

◆ SubsetType

template<typename SetType , typename DataType , typename SuperMapType , typename StridePolicy = policies::StrideOne<typename SetType::PositionType>>
using axom::slam::SubMap< SetType, DataType, SuperMapType, StridePolicy >::SubsetType = OrderedSet<SetPosition, SetElement, policies::RuntimeSize<SetPosition>, policies::ZeroOffset<SetPosition>, policies::StrideOne<SetPosition>, policies::STLVectorIndirection<SetPosition, SetElement> >

◆ SubsetBuilder

template<typename SetType , typename DataType , typename SuperMapType , typename StridePolicy = policies::StrideOne<typename SetType::PositionType>>
using axom::slam::SubMap< SetType, DataType, SuperMapType, StridePolicy >::SubsetBuilder = typename SubsetType::SetBuilder

◆ const_iterator

template<typename SetType , typename DataType , typename SuperMapType , typename StridePolicy = policies::StrideOne<typename SetType::PositionType>>
using axom::slam::SubMap< SetType, DataType, SuperMapType, StridePolicy >::const_iterator = SubMapIterator

◆ const_iterator_pair

template<typename SetType , typename DataType , typename SuperMapType , typename StridePolicy = policies::StrideOne<typename SetType::PositionType>>
using axom::slam::SubMap< SetType, DataType, SuperMapType, StridePolicy >::const_iterator_pair = std::pair<const_iterator, const_iterator>

◆ iterator

template<typename SetType , typename DataType , typename SuperMapType , typename StridePolicy = policies::StrideOne<typename SetType::PositionType>>
using axom::slam::SubMap< SetType, DataType, SuperMapType, StridePolicy >::iterator = const_iterator

◆ iterator_pair

template<typename SetType , typename DataType , typename SuperMapType , typename StridePolicy = policies::StrideOne<typename SetType::PositionType>>
using axom::slam::SubMap< SetType, DataType, SuperMapType, StridePolicy >::iterator_pair = const_iterator_pair

Constructor & Destructor Documentation

◆ SubMap() [1/5]

template<typename SetType , typename DataType , typename SuperMapType , typename StridePolicy = policies::StrideOne<typename SetType::PositionType>>
axom::slam::SubMap< SetType, DataType, SuperMapType, StridePolicy >::SubMap ( )
inline

Default Constructor

◆ SubMap() [2/5]

template<typename SetType , typename DataType , typename SuperMapType , typename StridePolicy = policies::StrideOne<typename SetType::PositionType>>
axom::slam::SubMap< SetType, DataType, SuperMapType, StridePolicy >::SubMap ( const SuperMapType *  supermap,
SetType &  subset_idx 
)
inline

Constructor for SubMap given the ElementFlatIndex into the SuperMap.

Parameters
supermapThe map that this SubMap is a subset of.
subset_idxa Set of ElementFlatIndex into the SuperMap

References axom::slam::SubMap< SetType, DataType, SuperMapType, StridePolicy >::m_subsetIdx_data.

◆ SubMap() [3/5]

template<typename SetType , typename DataType , typename SuperMapType , typename StridePolicy = policies::StrideOne<typename SetType::PositionType>>
axom::slam::SubMap< SetType, DataType, SuperMapType, StridePolicy >::SubMap ( SuperMapType *  supermap,
SetType &  subset_idx 
)
inline

◆ SubMap() [4/5]

template<typename SetType , typename DataType , typename SuperMapType , typename StridePolicy = policies::StrideOne<typename SetType::PositionType>>
axom::slam::SubMap< SetType, DataType, SuperMapType, StridePolicy >::SubMap ( const SubMap< SetType, DataType, SuperMapType, StridePolicy > &  otherMap)
inline

Copy Constructor

◆ SubMap() [5/5]

template<typename SetType , typename DataType , typename SuperMapType , typename StridePolicy = policies::StrideOne<typename SetType::PositionType>>
axom::slam::SubMap< SetType, DataType, SuperMapType, StridePolicy >::SubMap ( SubMap< SetType, DataType, SuperMapType, StridePolicy > &&  otherMap)
inline

Move Constructor

Member Function Documentation

◆ operator=() [1/2]

template<typename SetType , typename DataType , typename SuperMapType , typename StridePolicy = policies::StrideOne<typename SetType::PositionType>>
SubMap& axom::slam::SubMap< SetType, DataType, SuperMapType, StridePolicy >::operator= ( const SubMap< SetType, DataType, SuperMapType, StridePolicy > &  otherMap)
inline

◆ operator=() [2/2]

template<typename SetType , typename DataType , typename SuperMapType , typename StridePolicy = policies::StrideOne<typename SetType::PositionType>>
SubMap& axom::slam::SubMap< SetType, DataType, SuperMapType, StridePolicy >::operator= ( SubMap< SetType, DataType, SuperMapType, StridePolicy > &&  otherMap)
inline

◆ operator[]() [1/2]

template<typename SetType , typename DataType , typename SuperMapType , typename StridePolicy = policies::StrideOne<typename SetType::PositionType>>
const DataType& axom::slam::SubMap< SetType, DataType, SuperMapType, StridePolicy >::operator[] ( IndexType  idx) const
inline

Access the value in the SubMap given the ComponentFlatIndex.

Parameters
idxthe ComponentFlatIndex into the subset
Returns
The value for the jth component of the ith element, where setIndex = i * numComp() + j.
Precondition
0 <= idx < size() * numComp()

References axom::slam::SubMap< SetType, DataType, SuperMapType, StridePolicy >::m_superMap_constptr.

◆ operator[]() [2/2]

template<typename SetType , typename DataType , typename SuperMapType , typename StridePolicy = policies::StrideOne<typename SetType::PositionType>>
DataType& axom::slam::SubMap< SetType, DataType, SuperMapType, StridePolicy >::operator[] ( IndexType  idx)
inline

◆ operator()() [1/2]

template<typename SetType , typename DataType , typename SuperMapType , typename StridePolicy = policies::StrideOne<typename SetType::PositionType>>
const DataType& axom::slam::SubMap< SetType, DataType, SuperMapType, StridePolicy >::operator() ( IndexType  idx,
IndexType  comp = 0 
) const
inline

◆ operator()() [2/2]

template<typename SetType , typename DataType , typename SuperMapType , typename StridePolicy = policies::StrideOne<typename SetType::PositionType>>
DataType& axom::slam::SubMap< SetType, DataType, SuperMapType, StridePolicy >::operator() ( IndexType  idx,
IndexType  comp = 0 
)
inline

◆ value() [1/2]

template<typename SetType , typename DataType , typename SuperMapType , typename StridePolicy = policies::StrideOne<typename SetType::PositionType>>
const DataType& axom::slam::SubMap< SetType, DataType, SuperMapType, StridePolicy >::value ( IndexType  idx,
IndexType  comp = 0 
) const
inline

Access the value associated with the given position in the subset and the component index.

Precondition
0 <= idx < size()
0 <= comp < numComp()

References axom::slam::SubMap< SetType, DataType, SuperMapType, StridePolicy >::operator()().

◆ value() [2/2]

template<typename SetType , typename DataType , typename SuperMapType , typename StridePolicy = policies::StrideOne<typename SetType::PositionType>>
DataType& axom::slam::SubMap< SetType, DataType, SuperMapType, StridePolicy >::value ( IndexType  idx,
IndexType  comp = 0 
)
inline

◆ index()

template<typename SetType , typename DataType , typename SuperMapType , typename StridePolicy = policies::StrideOne<typename SetType::PositionType>>
IndexType axom::slam::SubMap< SetType, DataType, SuperMapType, StridePolicy >::index ( IndexType  idx) const
inline

◆ size()

template<typename SetType , typename DataType , typename SuperMapType , typename StridePolicy = policies::StrideOne<typename SetType::PositionType>>
IndexType axom::slam::SubMap< SetType, DataType, SuperMapType, StridePolicy >::size ( ) const
inlineoverridevirtual

◆ numComp()

template<typename SetType , typename DataType , typename SuperMapType , typename StridePolicy = policies::StrideOne<typename SetType::PositionType>>
IndexType axom::slam::SubMap< SetType, DataType, SuperMapType, StridePolicy >::numComp ( ) const
inline

◆ isValid()

template<typename SetType , typename DataType , typename SuperMapType , typename StridePolicy = policies::StrideOne<typename SetType::PositionType>>
bool axom::slam::SubMap< SetType, DataType, SuperMapType, StridePolicy >::isValid ( bool  verboseOutput = false) const
inlineoverridevirtual

◆ begin()

template<typename SetType , typename DataType , typename SuperMapType , typename StridePolicy = policies::StrideOne<typename SetType::PositionType>>
SubMapIterator axom::slam::SubMap< SetType, DataType, SuperMapType, StridePolicy >::begin ( )
inline

◆ end()

template<typename SetType , typename DataType , typename SuperMapType , typename StridePolicy = policies::StrideOne<typename SetType::PositionType>>
SubMapIterator axom::slam::SubMap< SetType, DataType, SuperMapType, StridePolicy >::end ( )
inline

Member Data Documentation

◆ m_superMap_constptr

template<typename SetType , typename DataType , typename SuperMapType , typename StridePolicy = policies::StrideOne<typename SetType::PositionType>>
const SuperMapType* axom::slam::SubMap< SetType, DataType, SuperMapType, StridePolicy >::m_superMap_constptr
protected

◆ m_superMap_ptr

template<typename SetType , typename DataType , typename SuperMapType , typename StridePolicy = policies::StrideOne<typename SetType::PositionType>>
SuperMapType* axom::slam::SubMap< SetType, DataType, SuperMapType, StridePolicy >::m_superMap_ptr
protected

◆ m_subsetIdx_data

template<typename SetType , typename DataType , typename SuperMapType , typename StridePolicy = policies::StrideOne<typename SetType::PositionType>>
std::vector<IndexType> axom::slam::SubMap< SetType, DataType, SuperMapType, StridePolicy >::m_subsetIdx_data
protected

◆ m_subsetIdx


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