AXOM
Axom provides a robust, flexible software infrastructure for the development of multi-physics applications and computational tools.
axom::slam::SubMap< SuperMapType, SubsetType, InterfacePolicy > 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/latest/src/axom/slam/SubMap.hpp>

Inheritance diagram for axom::slam::SubMap< SuperMapType, SubsetType, InterfacePolicy >:

Classes

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

Public Types

using DataType = typename SuperMapType::DataType
 
using SetPosition = typename SubsetType::PositionType
 
using SetElement = typename SubsetType::ElementType
 
using StridePolicyType = typename SuperMapType::StridePolicyType
 
using IndirectionPolicyType = typename SuperMapType::IndirectionPolicy
 
using MapType = Map< DataType, SubsetType, IndirectionPolicyType, StridePolicyType >
 
using SubsetBuilder = typename SubsetType::SetBuilder
 
using iterator = SubMapIterator
 
using iterator_pair = std::pair< iterator, iterator >
 
using ValueType = typename IndirectionPolicyType::IndirectionResult
 
using ConstValueType = typename IndirectionPolicyType::ConstIndirectionResult
 
using DataRefType = std::conditional_t< std::is_const< SuperMapType >::value, ConstValueType, ValueType >
 

Public Member Functions

 SubMap ()
 
AXOM_HOST_DEVICE SubMap (SuperMapType *supermap, SubsetType subset_idxset, bool indicesHaveIndirection=true)
 Constructor for SubMap given the ElementFlatIndex into the SuperMap. More...
 
bool isValid (bool VerboseOutput=false) const
 
AXOM_HOST_DEVICE iterator begin () const
 
AXOM_HOST_DEVICE iterator end () const
 
SubMap individual access functions
DataRefType operator[] (IndexType idx) const
 Access the value in the SubMap given the ComponentFlatIndex. More...
 
AXOM_HOST_DEVICE DataRefType operator() (IndexType idx, IndexType comp=0) const
 Access the value associated with the given position in the subset and the component index. More...
 
DataRefType value (IndexType idx, IndexType comp=0) const
 Access the value associated with the given position in the subset and the component index. More...
 
IndexType index (IndexType idx) const
 Return the set element in the SuperMap at the given subset index. More...
 
SubMap cardinality functions
AXOM_HOST_DEVICE IndexType size () const
 returns the size of the SubMap
More...
 
AXOM_HOST_DEVICE IndexType numComp () const
 returns the number of components (aka. stride) of the SubMap
More...
 

Protected Attributes

SuperMapType * m_superMap
 
SubsetType m_subsetIdx
 
bool m_indicesHaveIndirection
 

Detailed Description

template<typename SuperMapType, typename SubsetType, typename InterfacePolicy = policies::VirtualInterface>
class axom::slam::SubMap< SuperMapType, SubsetType, InterfacePolicy >

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
SuperMapTypethe type of SuperMap
SetTypedefines the indices int the super map. SetType cannot be abstract.
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

◆ DataType

template<typename SuperMapType , typename SubsetType , typename InterfacePolicy = policies::VirtualInterface>
using axom::slam::SubMap< SuperMapType, SubsetType, InterfacePolicy >::DataType = typename SuperMapType::DataType

◆ SetPosition

template<typename SuperMapType , typename SubsetType , typename InterfacePolicy = policies::VirtualInterface>
using axom::slam::SubMap< SuperMapType, SubsetType, InterfacePolicy >::SetPosition = typename SubsetType::PositionType

◆ SetElement

template<typename SuperMapType , typename SubsetType , typename InterfacePolicy = policies::VirtualInterface>
using axom::slam::SubMap< SuperMapType, SubsetType, InterfacePolicy >::SetElement = typename SubsetType::ElementType

◆ StridePolicyType

template<typename SuperMapType , typename SubsetType , typename InterfacePolicy = policies::VirtualInterface>
using axom::slam::SubMap< SuperMapType, SubsetType, InterfacePolicy >::StridePolicyType = typename SuperMapType::StridePolicyType

◆ IndirectionPolicyType

template<typename SuperMapType , typename SubsetType , typename InterfacePolicy = policies::VirtualInterface>
using axom::slam::SubMap< SuperMapType, SubsetType, InterfacePolicy >::IndirectionPolicyType = typename SuperMapType::IndirectionPolicy

◆ MapType

template<typename SuperMapType , typename SubsetType , typename InterfacePolicy = policies::VirtualInterface>
using axom::slam::SubMap< SuperMapType, SubsetType, InterfacePolicy >::MapType = Map<DataType, SubsetType, IndirectionPolicyType, StridePolicyType>

◆ SubsetBuilder

template<typename SuperMapType , typename SubsetType , typename InterfacePolicy = policies::VirtualInterface>
using axom::slam::SubMap< SuperMapType, SubsetType, InterfacePolicy >::SubsetBuilder = typename SubsetType::SetBuilder

◆ iterator

template<typename SuperMapType , typename SubsetType , typename InterfacePolicy = policies::VirtualInterface>
using axom::slam::SubMap< SuperMapType, SubsetType, InterfacePolicy >::iterator = SubMapIterator

◆ iterator_pair

template<typename SuperMapType , typename SubsetType , typename InterfacePolicy = policies::VirtualInterface>
using axom::slam::SubMap< SuperMapType, SubsetType, InterfacePolicy >::iterator_pair = std::pair<iterator, iterator>

◆ ValueType

template<typename SuperMapType , typename SubsetType , typename InterfacePolicy = policies::VirtualInterface>
using axom::slam::SubMap< SuperMapType, SubsetType, InterfacePolicy >::ValueType = typename IndirectionPolicyType::IndirectionResult

◆ ConstValueType

template<typename SuperMapType , typename SubsetType , typename InterfacePolicy = policies::VirtualInterface>
using axom::slam::SubMap< SuperMapType, SubsetType, InterfacePolicy >::ConstValueType = typename IndirectionPolicyType::ConstIndirectionResult

◆ DataRefType

template<typename SuperMapType , typename SubsetType , typename InterfacePolicy = policies::VirtualInterface>
using axom::slam::SubMap< SuperMapType, SubsetType, InterfacePolicy >::DataRefType = std::conditional_t<std::is_const<SuperMapType>::value, ConstValueType, ValueType>

Constructor & Destructor Documentation

◆ SubMap() [1/2]

template<typename SuperMapType , typename SubsetType , typename InterfacePolicy = policies::VirtualInterface>
axom::slam::SubMap< SuperMapType, SubsetType, InterfacePolicy >::SubMap ( )
inline

Default Constructor

◆ SubMap() [2/2]

template<typename SuperMapType , typename SubsetType , typename InterfacePolicy = policies::VirtualInterface>
AXOM_HOST_DEVICE axom::slam::SubMap< SuperMapType, SubsetType, InterfacePolicy >::SubMap ( SuperMapType *  supermap,
SubsetType  subset_idxset,
bool  indicesHaveIndirection = true 
)
inline

Constructor for SubMap given the ElementFlatIndex into the SuperMap.

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

Member Function Documentation

◆ operator[]()

template<typename SuperMapType , typename SubsetType , typename InterfacePolicy = policies::VirtualInterface>
DataRefType axom::slam::SubMap< SuperMapType, SubsetType, InterfacePolicy >::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< SuperMapType, SubsetType, InterfacePolicy >::m_superMap.

◆ operator()()

template<typename SuperMapType , typename SubsetType , typename InterfacePolicy = policies::VirtualInterface>
AXOM_HOST_DEVICE DataRefType axom::slam::SubMap< SuperMapType, SubsetType, InterfacePolicy >::operator() ( 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< SuperMapType, SubsetType, InterfacePolicy >::m_superMap, axom::slam::SubMap< SuperMapType, SubsetType, InterfacePolicy >::numComp(), and SLIC_ASSERT_MSG.

◆ value()

template<typename SuperMapType , typename SubsetType , typename InterfacePolicy = policies::VirtualInterface>
DataRefType axom::slam::SubMap< SuperMapType, SubsetType, InterfacePolicy >::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< SuperMapType, SubsetType, InterfacePolicy >::operator()().

◆ index()

template<typename SuperMapType , typename SubsetType , typename InterfacePolicy = policies::VirtualInterface>
IndexType axom::slam::SubMap< SuperMapType, SubsetType, InterfacePolicy >::index ( IndexType  idx) const
inline

◆ size()

template<typename SuperMapType , typename SubsetType , typename InterfacePolicy = policies::VirtualInterface>
AXOM_HOST_DEVICE IndexType axom::slam::SubMap< SuperMapType, SubsetType, InterfacePolicy >::size ( ) const
inline

◆ numComp()

template<typename SuperMapType , typename SubsetType , typename InterfacePolicy = policies::VirtualInterface>
AXOM_HOST_DEVICE IndexType axom::slam::SubMap< SuperMapType, SubsetType, InterfacePolicy >::numComp ( ) const
inline

returns the number of components (aka. stride) of the SubMap

◆ isValid()

template<typename SuperMapType , typename SetType , typename InterfacePolicy >
bool axom::slam::SubMap< SuperMapType, SetType, InterfacePolicy >::isValid ( bool  VerboseOutput = false) const

References SLIC_INFO.

◆ begin()

template<typename SuperMapType , typename SubsetType , typename InterfacePolicy = policies::VirtualInterface>
AXOM_HOST_DEVICE iterator axom::slam::SubMap< SuperMapType, SubsetType, InterfacePolicy >::begin ( ) const
inline

◆ end()

template<typename SuperMapType , typename SubsetType , typename InterfacePolicy = policies::VirtualInterface>
AXOM_HOST_DEVICE iterator axom::slam::SubMap< SuperMapType, SubsetType, InterfacePolicy >::end ( ) const
inline

Member Data Documentation

◆ m_superMap

template<typename SuperMapType , typename SubsetType , typename InterfacePolicy = policies::VirtualInterface>
SuperMapType* axom::slam::SubMap< SuperMapType, SubsetType, InterfacePolicy >::m_superMap
protected

◆ m_subsetIdx

template<typename SuperMapType , typename SubsetType , typename InterfacePolicy = policies::VirtualInterface>
SubsetType axom::slam::SubMap< SuperMapType, SubsetType, InterfacePolicy >::m_subsetIdx
protected

◆ m_indicesHaveIndirection

template<typename SuperMapType , typename SubsetType , typename InterfacePolicy = policies::VirtualInterface>
bool axom::slam::SubMap< SuperMapType, SubsetType, InterfacePolicy >::m_indicesHaveIndirection
protected

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