AXOM
Axom provides a robust, flexible software infrastructure for the development of multi-physics applications and computational tools.
|
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>
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 |
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.
SuperMapType | the type of SuperMap |
SetType | defines the indices int the super map. SetType cannot be abstract. |
using axom::slam::SubMap< SuperMapType, SubsetType, InterfacePolicy >::DataType = typename SuperMapType::DataType |
using axom::slam::SubMap< SuperMapType, SubsetType, InterfacePolicy >::SetPosition = typename SubsetType::PositionType |
using axom::slam::SubMap< SuperMapType, SubsetType, InterfacePolicy >::SetElement = typename SubsetType::ElementType |
using axom::slam::SubMap< SuperMapType, SubsetType, InterfacePolicy >::StridePolicyType = typename SuperMapType::StridePolicyType |
using axom::slam::SubMap< SuperMapType, SubsetType, InterfacePolicy >::IndirectionPolicyType = typename SuperMapType::IndirectionPolicy |
using axom::slam::SubMap< SuperMapType, SubsetType, InterfacePolicy >::MapType = Map<DataType, SubsetType, IndirectionPolicyType, StridePolicyType> |
using axom::slam::SubMap< SuperMapType, SubsetType, InterfacePolicy >::SubsetBuilder = typename SubsetType::SetBuilder |
using axom::slam::SubMap< SuperMapType, SubsetType, InterfacePolicy >::iterator = SubMapIterator |
using axom::slam::SubMap< SuperMapType, SubsetType, InterfacePolicy >::iterator_pair = std::pair<iterator, iterator> |
using axom::slam::SubMap< SuperMapType, SubsetType, InterfacePolicy >::ValueType = typename IndirectionPolicyType::IndirectionResult |
using axom::slam::SubMap< SuperMapType, SubsetType, InterfacePolicy >::ConstValueType = typename IndirectionPolicyType::ConstIndirectionResult |
using axom::slam::SubMap< SuperMapType, SubsetType, InterfacePolicy >::DataRefType = std::conditional_t<std::is_const<SuperMapType>::value, ConstValueType, ValueType> |
|
inline |
Default Constructor
|
inline |
|
inline |
Access the value in the SubMap given the ComponentFlatIndex.
idx | the ComponentFlatIndex into the subset |
setIndex = i * numComp() + j
. References axom::slam::SubMap< SuperMapType, SubsetType, InterfacePolicy >::m_superMap.
|
inline |
Access the value associated with the given position in the subset and the component index.
References axom::slam::SubMap< SuperMapType, SubsetType, InterfacePolicy >::m_superMap, axom::slam::SubMap< SuperMapType, SubsetType, InterfacePolicy >::numComp(), and SLIC_ASSERT_MSG.
|
inline |
Access the value associated with the given position in the subset and the component index.
References axom::slam::SubMap< SuperMapType, SubsetType, InterfacePolicy >::operator()().
|
inline |
Return the set element in the SuperMap at the given subset index.
References axom::slam::SubMap< SuperMapType, SubsetType, InterfacePolicy >::m_indicesHaveIndirection, axom::slam::SubMap< SuperMapType, SubsetType, InterfacePolicy >::m_subsetIdx, and axom::slam::SubMap< SuperMapType, SubsetType, InterfacePolicy >::m_superMap.
|
inline |
returns the size of the SubMap
References axom::slam::SubMap< SuperMapType, SubsetType, InterfacePolicy >::m_subsetIdx.
|
inline |
returns the number of components (aka. stride) of the SubMap
bool axom::slam::SubMap< SuperMapType, SetType, InterfacePolicy >::isValid | ( | bool | VerboseOutput = false | ) | const |
References SLIC_INFO.
|
inline |
|
inline |
|
protected |
|
protected |
|
protected |