|
AXOM
Axom provides a robust, flexible software infrastructure for the development of multi-physics applications and computational tools.
|
A Set class that supports dynamically adding and removing set items. More...
#include </home/docs/checkouts/readthedocs.org/user_builds/axom/checkouts/main/src/axom/slam/DynamicSet.hpp>

Classes | |
| class | DynamicSetIterator |
| An stl-compliant random iterator type for a DynamicSet. More... | |
| class | SetBuilder |
| Helper class for constructing a DynamicSet. More... | |
Public Types | |
| using | PositionType = PosType |
| using | ElementType = ElemType |
| using | SetVectorType = std::vector< ElementType > |
| using | SizePolicyType = SizePolicy |
| using | const_iterator = DynamicSetIterator< ElementType, true > |
| using | const_iterator_pair = std::pair< const_iterator, const_iterator > |
| using | iterator = DynamicSetIterator< ElementType, false > |
| using | iterator_pair = std::pair< iterator, iterator > |
Public Member Functions | |
| DynamicSet (PositionType size=SizePolicyType::DEFAULT_VALUE) | |
| Constructor for a DynamicSet. More... | |
| DynamicSet (const SetBuilder &builder) | |
| Constructor for a DynamicSet from a SetBuilder. More... | |
| iterator | begin () |
| const_iterator | begin () const |
| const_iterator | cbegin () const |
| iterator | end () |
| const_iterator | end () const |
| const_iterator | cend () const |
| virtual ElementType | at (PositionType) const=0 |
| Random access to the entities of the set. More... | |
DynamicSet element access functions | |
| ElementType | at (PositionType pos) const |
| Access the element at position pos. More... | |
| const ElementType & | operator[] (IndexType pos) const |
| Access the element at position pos. More... | |
| ElementType & | operator[] (IndexType pos) |
| Access the element at position pos. More... | |
| SetVectorType & | data () |
| Returns a reference to the underlying set data. More... | |
| const SetVectorType & | data () const |
| Returns a const reference to the underlying set data. More... | |
| IndexType | findIndex (ElementType e) const |
| Given a value, find the index of the first entry containing it. More... | |
| bool | contains (ElementType e) const |
| Checks whether an element exists within the DynamicSet. More... | |
Functions that deal with the set cardinality and indexing | |
| AXOM_HOST_DEVICE PositionType | size () const |
| Returns the number of possible elements in the set. More... | |
| AXOM_HOST_DEVICE bool | empty () const |
| Uses SizePolicy::empty() to determine if the set is empty. More... | |
| PositionSet< PositionType > | positions () const |
| Returns a positionset over the set elements. More... | |
| PositionType | numberOfValidEntries () const |
| Return the number of valid entries in the set. More... | |
| bool | isSubset () const |
| Returns true if this set is a subset of another set. More... | |
Functions that deal with validity checks | |
| bool | isValidEntry (IndexType i) const |
| Predicate to check if the entry at index i is valid. More... | |
| bool | isValid (bool verboseOutput=false) const |
| Returns true if the DynamicSet instance is valid. More... | |
Functions that modify the set cardinality | |
| IndexType | insert () |
| Insert an entry at the end of the set with value = ( size()-1 ) More... | |
| IndexType | insert (ElementType val) |
| Insert an entry at the end of the set with the given value. More... | |
| void | remove (IndexType idx) |
| Mark the corresponding entry as invalid. More... | |
| void | reset (PositionType sz) |
| Resets to a default DynamicSet of size sz. More... | |
Static Public Attributes | |
| static constexpr ElementType | INVALID_ENTRY = ~0 |
| value to mark indices of deleted elements More... | |
Private Member Functions | |
| AXOM_HOST_DEVICE slam::DefaultPositionType & | size () |
A Set class that supports dynamically adding and removing set items.
\detail An entry in the set is valid if it is not equal to INVALID_ENTRY.
An example to traverse the elements
| using axom::slam::DynamicSet< PosType, ElemType, SizePolicy >::PositionType = PosType |
| using axom::slam::DynamicSet< PosType, ElemType, SizePolicy >::ElementType = ElemType |
| using axom::slam::DynamicSet< PosType, ElemType, SizePolicy >::SetVectorType = std::vector<ElementType> |
| using axom::slam::DynamicSet< PosType, ElemType, SizePolicy >::SizePolicyType = SizePolicy |
| using axom::slam::DynamicSet< PosType, ElemType, SizePolicy >::const_iterator = DynamicSetIterator<ElementType, true> |
| using axom::slam::DynamicSet< PosType, ElemType, SizePolicy >::const_iterator_pair = std::pair<const_iterator, const_iterator> |
| using axom::slam::DynamicSet< PosType, ElemType, SizePolicy >::iterator = DynamicSetIterator<ElementType, false> |
| using axom::slam::DynamicSet< PosType, ElemType, SizePolicy >::iterator_pair = std::pair<iterator, iterator> |
|
inline |
Constructor for a DynamicSet.
| size | The initial size of the set |
References axom::slam::DynamicSet< PosType, ElemType, SizePolicy >::size().
|
inline |
Constructor for a DynamicSet from a SetBuilder.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Access the element at position pos.
References axom::slam::DynamicSet< PosType, ElemType, SizePolicy >::operator[]().
|
inline |
Access the element at position pos.
|
inline |
Access the element at position pos.
|
inline |
Returns a reference to the underlying set data.
|
inline |
Returns a const reference to the underlying set data.
|
inline |
Given a value, find the index of the first entry containing it.
References axom::slam::DynamicSet< PosType, ElemType, SizePolicy >::INVALID_ENTRY, and axom::slam::DynamicSet< PosType, ElemType, SizePolicy >::size().
|
inline |
Checks whether an element exists within the DynamicSet.
References axom::slam::DynamicSet< PosType, ElemType, SizePolicy >::size().
|
inlinevirtual |
Returns the number of possible elements in the set.
Implements axom::slam::Set< slam::DefaultPositionType, slam::DefaultElementType >.
|
inlinevirtual |
Uses SizePolicy::empty() to determine if the set is empty.
Implements axom::slam::Set< slam::DefaultPositionType, slam::DefaultElementType >.
|
inline |
Returns a positionset over the set elements.
References axom::slam::DynamicSet< PosType, ElemType, SizePolicy >::size().
|
inline |
Return the number of valid entries in the set.
This is an O(n) operation, because the class makes no assumption that data was not changed by the user
References axom::slam::DynamicSet< PosType, ElemType, SizePolicy >::INVALID_ENTRY, and axom::slam::DynamicSet< PosType, ElemType, SizePolicy >::size().
|
inlinevirtual |
Returns true if this set is a subset of another set.
Implements axom::slam::Set< slam::DefaultPositionType, slam::DefaultElementType >.
|
inline |
Predicate to check if the entry at index i is valid.
The entry is valid when 0 <= i < size() and the value at index i is not marked as INVALID_ENTRY
References axom::slam::DynamicSet< PosType, ElemType, SizePolicy >::INVALID_ENTRY, and axom::slam::DynamicSet< PosType, ElemType, SizePolicy >::size().
|
inlinevirtual |
Returns true if the DynamicSet instance is valid.
A DynamicSet is valid if each of its policies claim it to be valid. This includes its SizePolicy, OffsetPolicy and StridePolicy
Implements axom::slam::Set< slam::DefaultPositionType, slam::DefaultElementType >.
|
inline |
Insert an entry at the end of the set with value = ( size()-1 )
References axom::slam::DynamicSet< PosType, ElemType, SizePolicy >::insert(), and axom::slam::DynamicSet< PosType, ElemType, SizePolicy >::size().
|
inline |
Insert an entry at the end of the set with the given value.
| val | the value of the inserted entry |
References axom::slam::DynamicSet< PosType, ElemType, SizePolicy >::size().
|
inline |
Mark the corresponding entry as invalid.
References axom::slam::DynamicSet< PosType, ElemType, SizePolicy >::INVALID_ENTRY.
|
inline |
Resets to a default DynamicSet of size sz.
The entry at index i will have the value of i for 0 <= i < sz
|
pure virtualinherited |
Random access to the entities of the set.
| The | index of the desired element |
Implemented in axom::slam::NullSet< slam::DefaultPositionType, slam::DefaultElementType >.
|
staticconstexpr |
value to mark indices of deleted elements