AXOM
Axom provides a robust, flexible software infrastructure for the development of multi-physics applications and computational tools.
|
A relation class with constant cardinality that supports adding, removing and modifying set relations. More...
#include </home/docs/checkouts/readthedocs.org/user_builds/axom/checkouts/v0.5.0/src/axom/slam/DynamicConstantRelation.hpp>
Inherits CardinalityPolicy.
Public Types | |
enum | { INVALID_INDEX = ~0 } |
using | SetPosition = PosType |
using | SetElement = ElemType |
using | RelationVec = std::vector< SetPosition > |
using | FromSetType = DynamicSet< PosType, ElemType > |
using | ToSetType = DynamicSet< PosType, ElemType > |
using | BeginsSizePolicy = typename CardinalityPolicy::RelationalOperatorSizeType |
using | STLIndirection = policies::STLVectorIndirection< SetPosition, SetElement > |
using | RelationSubset = OrderedSet< SetPosition, SetElement, BeginsSizePolicy, policies::RuntimeOffset< SetPosition >, policies::StrideOne< SetPosition >, STLIndirection > |
using | RelationIterator = typename RelationSubset::iterator |
using | RelationIteratorPair = typename RelationSubset::iterator_pair |
using | RelationConstIterator = typename RelationSubset::const_iterator |
using | RelationConstIteratorPair = typename RelationSubset::const_iterator_pair |
Public Member Functions | |
DynamicConstantRelation () | |
Default constructor with empty set for toSet and fromSet. More... | |
DynamicConstantRelation (FromSetType *fromSet, ToSetType *toSet) | |
Construct a DynamicConstantRelation from the given fromSet to toSet. More... | |
~DynamicConstantRelation () | |
SetPosition | size () const |
Returns the cardinality of the FromSet. More... | |
RelationVec & | data () |
Direct access to the relation data. More... | |
const RelationVec & | data () const |
Direct const access to the relation data. More... | |
DynamicConstantRelation iterator interface | |
RelationIterator | begin (SetPosition fromSetInd) |
Returns a begin iterator to the set of entities in the ToSet that are related to the element with index fromSetInd in the FromSet. More... | |
RelationConstIterator | begin (SetPosition fromSetInd) const |
Returns a begin const iterator to the set of entities in the ToSet that are related to the element with index fromSetInd in the FromSet. More... | |
RelationIterator | end (SetPosition fromSetInd) |
Returns an end iterator to the set of entities in the ToSet that are related to the element with index fromSetInd in the FromSet. More... | |
RelationConstIterator | end (SetPosition fromSetInd) const |
Returns a end const iterator to the set of entities in the ToSet that are related to the element with index fromSetInd in the FromSet. More... | |
RelationIteratorPair | range (SetPosition fromSetInd) |
Returns an iterator range to the set of entities in the ToSet that are related to the element with index fromSetInd in the FromSet. More... | |
RelationConstIteratorPair | range (SetPosition fromSetInd) const |
Returns a const iterator range to the set of entities in the ToSet that are related to the element with index fromSetInd in the FromSet. More... | |
DynamicConstantRelation per-element relation access functions | |
RelationSubset const | at (SetPosition fromSetIndex) const |
Returns the const set of entities in the ToSet related to the element with index fromSetIndex in the FromSet. More... | |
RelationSubset | at (SetPosition fromSetIndex) |
RelationSubset const | operator[] (SetPosition fromSetIndex) const |
Returns the const set of entities in the ToSet related to the element with index fromSetIndex in the FromSet. More... | |
RelationSubset | operator[] (SetPosition fromSetIndex) |
SetPosition | size (SetPosition fromSetIndex) const |
Returns the cardinality of the set of entities in the ToSet related to the element with index fromSetIndex in the FromSet. More... | |
DynamicConstantRelation validity check functions | |
SetPosition | numberOfValidEntries () const |
Returns the number of valid entries in the FromSet. More... | |
bool | isValidEntry (SetPosition idx) const |
return if an entry is valid or not. an entry is considered valid if it has at least one valid value More... | |
bool | isValid (bool verboseOutput=false) const |
Predicate to check if the DynamicConstantRelation instance is valid. More... | |
DynamicConstantRelation functions that modify the relation | |
void | insert (SetPosition fromSetIndex, SetPosition toSetIndex) |
Inserts a new entry into the relation at the first invalid index. More... | |
void | modify (SetPosition fromSetIndex, SetPosition offset, SetPosition toSetIndex) |
Function to modify the value at offset offset of the FromSet index to the value toSetIndex. More... | |
void | remove (SetPosition fromSetIndex) |
Mark all values in entry fromSetIndex as invalid. More... | |
A relation class with constant cardinality that supports adding, removing and modifying set relations.
A DynamicConstantRelation encodes the relation between two sets, A FromSet and a ToSet, where the cardinality of the relation from each element of the FromSet to the ToSet is fixed to a constant value. For example, each triangle in the triangle set of a triangle mesh has three incident vertices from set of vertices.
The relation from an element of the FromSet to an element of the ToSet is considered to be valid if its entry in the FromSet is valid and at least one of its relation entities in the ToSet is valid (i.e. not equal to INVALID_INDEX).
using axom::slam::DynamicConstantRelation< PosType, ElemType, CardinalityPolicy >::SetPosition = PosType |
using axom::slam::DynamicConstantRelation< PosType, ElemType, CardinalityPolicy >::SetElement = ElemType |
using axom::slam::DynamicConstantRelation< PosType, ElemType, CardinalityPolicy >::RelationVec = std::vector<SetPosition> |
using axom::slam::DynamicConstantRelation< PosType, ElemType, CardinalityPolicy >::FromSetType = DynamicSet<PosType, ElemType> |
using axom::slam::DynamicConstantRelation< PosType, ElemType, CardinalityPolicy >::ToSetType = DynamicSet<PosType, ElemType> |
using axom::slam::DynamicConstantRelation< PosType, ElemType, CardinalityPolicy >::BeginsSizePolicy = typename CardinalityPolicy::RelationalOperatorSizeType |
using axom::slam::DynamicConstantRelation< PosType, ElemType, CardinalityPolicy >::STLIndirection = policies::STLVectorIndirection<SetPosition, SetElement> |
using axom::slam::DynamicConstantRelation< PosType, ElemType, CardinalityPolicy >::RelationSubset = OrderedSet<SetPosition, SetElement, BeginsSizePolicy, policies::RuntimeOffset<SetPosition>, policies::StrideOne<SetPosition>, STLIndirection> |
using axom::slam::DynamicConstantRelation< PosType, ElemType, CardinalityPolicy >::RelationIterator = typename RelationSubset::iterator |
using axom::slam::DynamicConstantRelation< PosType, ElemType, CardinalityPolicy >::RelationIteratorPair = typename RelationSubset::iterator_pair |
using axom::slam::DynamicConstantRelation< PosType, ElemType, CardinalityPolicy >::RelationConstIterator = typename RelationSubset::const_iterator |
using axom::slam::DynamicConstantRelation< PosType, ElemType, CardinalityPolicy >::RelationConstIteratorPair = typename RelationSubset::const_iterator_pair |
anonymous enum |
|
inline |
Default constructor with empty set for toSet and fromSet.
|
inline |
Construct a DynamicConstantRelation from the given fromSet to toSet.
References axom::slam::DynamicConstantRelation< PosType, ElemType, CardinalityPolicy >::INVALID_INDEX, and axom::slam::DynamicSet< PosType, ElemType, SizePolicy, OffsetPolicy, StridePolicy >::size().
|
inline |
|
inline |
Returns a begin iterator to the set of entities in the ToSet that are related to the element with index fromSetInd in the FromSet.
fromSetInd | The index of the element in the FromSet |
|
inline |
Returns a begin const iterator to the set of entities in the ToSet that are related to the element with index fromSetInd in the FromSet.
fromSetInd | The index of the element in the FromSet |
|
inline |
Returns an end iterator to the set of entities in the ToSet that are related to the element with index fromSetInd in the FromSet.
fromSetInd | The index of the element in the FromSet |
|
inline |
Returns a end const iterator to the set of entities in the ToSet that are related to the element with index fromSetInd in the FromSet.
fromSetInd | The index of the element in the FromSet |
|
inline |
Returns an iterator range to the set of entities in the ToSet that are related to the element with index fromSetInd in the FromSet.
fromSetInd | The index of the element in the FromSet |
|
inline |
Returns a const iterator range to the set of entities in the ToSet that are related to the element with index fromSetInd in the FromSet.
fromSetInd | The index of the element in the FromSet |
|
inline |
Returns the const set of entities in the ToSet related to the element with index fromSetIndex in the FromSet.
fromSetIndex | The index of an element in the FromSet |
References axom::slam::DynamicConstantRelation< PosType, ElemType, CardinalityPolicy >::operator[]().
|
inline |
|
inline |
Returns the const set of entities in the ToSet related to the element with index fromSetIndex in the FromSet.
fromSetIndex | The index of an element in the FromSet |
References axom::slam::OrderedSet< PosType, ElemType, SizePolicy, OffsetPolicy, StridePolicy, IndirectionPolicy, SubsettingPolicy >::SetBuilder::data(), axom::slam::OrderedSet< PosType, ElemType, SizePolicy, OffsetPolicy, StridePolicy, IndirectionPolicy, SubsettingPolicy >::SetBuilder::offset(), and axom::slam::OrderedSet< PosType, ElemType, SizePolicy, OffsetPolicy, StridePolicy, IndirectionPolicy, SubsettingPolicy >::SetBuilder::size().
Referenced by axom::slam::DynamicConstantRelation< PosType, ElemType, CardinalityPolicy >::at().
|
inline |
References axom::slam::OrderedSet< PosType, ElemType, SizePolicy, OffsetPolicy, StridePolicy, IndirectionPolicy, SubsettingPolicy >::SetBuilder::data(), axom::slam::OrderedSet< PosType, ElemType, SizePolicy, OffsetPolicy, StridePolicy, IndirectionPolicy, SubsettingPolicy >::SetBuilder::offset(), and axom::slam::OrderedSet< PosType, ElemType, SizePolicy, OffsetPolicy, StridePolicy, IndirectionPolicy, SubsettingPolicy >::SetBuilder::size().
|
inline |
Returns the cardinality of the set of entities in the ToSet related to the element with index fromSetIndex in the FromSet.
fromSetIndex | The index of an element in the FromSet |
|
inline |
Returns the cardinality of the FromSet.
Referenced by axom::slam::DynamicConstantRelation< PosType, ElemType, CardinalityPolicy >::numberOfValidEntries().
|
inline |
Returns the number of valid entries in the FromSet.
An element of the FromSet is considered valid with respect to a DynamicConstantRelation when it is valid in the FromSet and when its relation set is not marked as invalid.
References axom::slam::DynamicConstantRelation< PosType, ElemType, CardinalityPolicy >::isValidEntry(), and axom::slam::DynamicConstantRelation< PosType, ElemType, CardinalityPolicy >::size().
|
inline |
return if an entry is valid or not. an entry is considered valid if it has at least one valid value
References axom::slam::DynamicConstantRelation< PosType, ElemType, CardinalityPolicy >::INVALID_INDEX, and axom::slam::DynamicConstantRelation< PosType, ElemType, CardinalityPolicy >::isValid().
Referenced by axom::slam::DynamicConstantRelation< PosType, ElemType, CardinalityPolicy >::isValid(), axom::slam::DynamicConstantRelation< PosType, ElemType, CardinalityPolicy >::numberOfValidEntries(), and axom::slam::DynamicConstantRelation< PosType, ElemType, CardinalityPolicy >::remove().
bool axom::slam::DynamicConstantRelation< PosType, ElemType, CardinalityPolicy >::isValid | ( | bool | verboseOutput = false | ) | const |
Predicate to check if the DynamicConstantRelation instance is valid.
References axom::slam::DynamicSet< PosType, ElemType, SizePolicy, OffsetPolicy, StridePolicy >::at(), axom::slam::DynamicSet< PosType, ElemType, SizePolicy, OffsetPolicy, StridePolicy >::INVALID_ENTRY, axom::slam::DynamicConstantRelation< PosType, ElemType, CardinalityPolicy >::INVALID_INDEX, axom::slam::DynamicSet< PosType, ElemType, SizePolicy, OffsetPolicy, StridePolicy >::isValidEntry(), axom::slam::DynamicConstantRelation< PosType, ElemType, CardinalityPolicy >::isValidEntry(), axom::slam::DynamicSet< PosType, ElemType, SizePolicy, OffsetPolicy, StridePolicy >::size(), and SLIC_DEBUG.
Referenced by axom::slam::DynamicConstantRelation< PosType, ElemType, CardinalityPolicy >::isValidEntry().
|
inline |
Inserts a new entry into the relation at the first invalid index.
fromSetIndex | The index of the element in the FromSet |
toSetIndex | The index of the element in the ToSet to associate with fromSetIndex |
References axom::slam::DynamicConstantRelation< PosType, ElemType, CardinalityPolicy >::INVALID_INDEX, and SLIC_WARNING.
|
inline |
Function to modify the value at offset offset of the FromSet index to the value toSetIndex.
This should be replaced with operator[] which returns a non-const RelationSubset so users can more naturally update the relation. E.g. relation[fromSetIndex][offset] = toSetIndex;
|
inline |
Mark all values in entry fromSetIndex as invalid.
References axom::slam::DynamicConstantRelation< PosType, ElemType, CardinalityPolicy >::INVALID_INDEX, and axom::slam::DynamicConstantRelation< PosType, ElemType, CardinalityPolicy >::isValidEntry().
|
inline |
Direct access to the relation data.
|
inline |
Direct const access to the relation data.
References AXOM_DEBUG_PARAM, axom::slam::DynamicConstantRelation< PosType, ElemType, CardinalityPolicy >::INVALID_INDEX, axom::slam::DynamicSet< PosType, ElemType, SizePolicy, OffsetPolicy, StridePolicy >::size(), and SLIC_ASSERT_MSG.