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/v0.5.0/src/axom/slam/SubMap.hpp>
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) | |
SubMap & | operator= (const SubMap &otherMap) |
SubMap (SubMap &&otherMap) | |
SubMap & | operator= (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< IndexType > | m_subsetIdx_data |
SubsetType | m_subsetIdx |
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.
SetType | defines the Position and Element types of the underlying set |
DataType | the data type of the SuperMap |
SuperMapType | the type of SuperMap |
StridePolicy | the stride of SuperMap |
using axom::slam::SubMap< SetType, DataType, SuperMapType, StridePolicy >::IndexType = SetPosition |
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> > |
using axom::slam::SubMap< SetType, DataType, SuperMapType, StridePolicy >::SubsetBuilder = typename SubsetType::SetBuilder |
using axom::slam::SubMap< SetType, DataType, SuperMapType, StridePolicy >::const_iterator = SubMapIterator |
using axom::slam::SubMap< SetType, DataType, SuperMapType, StridePolicy >::const_iterator_pair = std::pair<const_iterator, const_iterator> |
using axom::slam::SubMap< SetType, DataType, SuperMapType, StridePolicy >::iterator = const_iterator |
using axom::slam::SubMap< SetType, DataType, SuperMapType, StridePolicy >::iterator_pair = const_iterator_pair |
|
inline |
Default Constructor
|
inline |
Constructor for SubMap given the ElementFlatIndex into the SuperMap.
supermap | The map that this SubMap is a subset of. |
subset_idx | a Set of ElementFlatIndex into the SuperMap |
References axom::slam::SubMap< SetType, DataType, SuperMapType, StridePolicy >::m_subsetIdx_data.
|
inline |
|
inline |
Copy Constructor
|
inline |
Move Constructor
|
inline |
Assignment Operator
References axom::slam::SubMap< SetType, DataType, SuperMapType, StridePolicy >::m_subsetIdx, axom::slam::SubMap< SetType, DataType, SuperMapType, StridePolicy >::m_subsetIdx_data, axom::slam::SubMap< SetType, DataType, SuperMapType, StridePolicy >::m_superMap_constptr, and axom::slam::SubMap< SetType, DataType, SuperMapType, StridePolicy >::m_superMap_ptr.
|
inline |
Move Assignment Operator
References axom::slam::SubMap< SetType, DataType, SuperMapType, StridePolicy >::m_subsetIdx, axom::slam::SubMap< SetType, DataType, SuperMapType, StridePolicy >::m_subsetIdx_data, axom::slam::SubMap< SetType, DataType, SuperMapType, StridePolicy >::m_superMap_constptr, and axom::slam::SubMap< SetType, DataType, SuperMapType, StridePolicy >::m_superMap_ptr.
|
inline |
Access the value in the SubMap given the ComponentFlatIndex.
idx | the ComponentFlatIndex into the subset |
setIndex = i * numComp() + j
. References axom::slam::SubMap< SetType, DataType, SuperMapType, StridePolicy >::m_superMap_constptr.
|
inline |
|
inline |
Access the value associated with the given position in the subset and the component index.
References axom::slam::SubMap< SetType, DataType, SuperMapType, StridePolicy >::m_superMap_constptr, and axom::slam::SubMap< SetType, DataType, SuperMapType, StridePolicy >::numComp().
Referenced by axom::slam::SubMap< SetType, DataType, SuperMapType, StridePolicy >::value().
|
inline |
|
inline |
Access the value associated with the given position in the subset and the component index.
References axom::slam::SubMap< SetType, DataType, SuperMapType, StridePolicy >::operator()().
|
inline |
|
inline |
Return the set element in the SuperMap at the given subset index.
References axom::slam::SubMap< SetType, DataType, SuperMapType, StridePolicy >::m_subsetIdx, and axom::slam::SubMap< SetType, DataType, SuperMapType, StridePolicy >::m_superMap_constptr.
Referenced by axom::slam::SubMap< SetType, DataType, SuperMapType, StridePolicy >::SubMapIterator::index().
|
inlineoverridevirtual |
returns the size of the SubMap
Implements axom::slam::MapBase< SetType::PositionType >.
References axom::slam::SubMap< SetType, DataType, SuperMapType, StridePolicy >::m_subsetIdx, and axom::slam::OrderedSet< PosType, ElemType, SizePolicy, OffsetPolicy, StridePolicy, IndirectionPolicy, SubsettingPolicy >::size().
|
inline |
returns the number of components (aka. stride) of the SubMap
Referenced by axom::slam::SubMap< SetType, DataType, SuperMapType, StridePolicy >::isValid(), axom::slam::SubMap< SetType, DataType, SuperMapType, StridePolicy >::SubMapIterator::numComp(), and axom::slam::SubMap< SetType, DataType, SuperMapType, StridePolicy >::operator()().
|
inlineoverridevirtual |
Checks whether the Map is valid.
Implements axom::slam::MapBase< SetType::PositionType >.
References AXOM_DEBUG_PARAM, axom::slam::SubMap< SetType, DataType, SuperMapType, StridePolicy >::m_subsetIdx, axom::slam::SubMap< SetType, DataType, SuperMapType, StridePolicy >::m_superMap_constptr, axom::slam::SubMap< SetType, DataType, SuperMapType, StridePolicy >::numComp(), axom::slam::OrderedSet< PosType, ElemType, SizePolicy, OffsetPolicy, StridePolicy, IndirectionPolicy, SubsettingPolicy >::size(), and SLIC_ASSERT_MSG.
|
inline |
|
inline |
References axom::slam::SubMap< SetType, DataType, SuperMapType, StridePolicy >::m_subsetIdx, axom::slam::OrderedSet< PosType, ElemType, SizePolicy, OffsetPolicy, StridePolicy, IndirectionPolicy, SubsettingPolicy >::size(), and axom::slam::SubMap< SetType, DataType, SuperMapType, StridePolicy >::SubMapIterator::SubMapIterator().
|
protected |
Referenced by axom::slam::SubMap< SetType, DataType, SuperMapType, StridePolicy >::index(), axom::slam::SubMap< SetType, DataType, SuperMapType, StridePolicy >::isValid(), axom::slam::SubMap< SetType, DataType, SuperMapType, StridePolicy >::operator()(), axom::slam::SubMap< SetType, DataType, SuperMapType, StridePolicy >::operator=(), and axom::slam::SubMap< SetType, DataType, SuperMapType, StridePolicy >::operator[]().
|
protected |
Referenced by axom::slam::SubMap< SetType, DataType, SuperMapType, StridePolicy >::operator()(), axom::slam::SubMap< SetType, DataType, SuperMapType, StridePolicy >::operator=(), axom::slam::SubMap< SetType, DataType, SuperMapType, StridePolicy >::operator[](), and axom::slam::SubMap< SetType, DataType, SuperMapType, StridePolicy >::SubMap().
|
protected |
|
protected |
Referenced by axom::slam::SubMap< SetType, DataType, SuperMapType, StridePolicy >::end(), axom::slam::SubMap< SetType, DataType, SuperMapType, StridePolicy >::index(), axom::slam::SubMap< SetType, DataType, SuperMapType, StridePolicy >::isValid(), axom::slam::SubMap< SetType, DataType, SuperMapType, StridePolicy >::operator=(), and axom::slam::SubMap< SetType, DataType, SuperMapType, StridePolicy >::size().