AXOM
Axom provides a robust, flexible software infrastructure for the development of multi-physics applications and computational tools.
|
Models a Set whose elements are derived from a relation, one element per fromSet and toSet pair in the relation. More...
#include </home/docs/checkouts/readthedocs.org/user_builds/axom/checkouts/v0.5.0/src/axom/slam/RelationSet.hpp>
Public Types | |
using | PositionType = typename RelationType::SetPosition |
using | ElementType = typename RelationType::SetElement |
using | RelationSubset = typename RelationType::RelationSubset |
using | BivariateSetType = BivariateSet< PositionType, ElementType > |
using | SetType = typename BivariateSetType::SetType |
using | OrderedSetType = typename BivariateSetType::OrderedSetType |
using | SizePolicyType = policies::RuntimeSize< RelationType::SetPosition > |
using | OffsetPolicyType = policies::ZeroOffset< RelationType::SetPosition > |
using | StridePolicyType = policies::StrideOne< RelationType::SetPosition > |
using | IndirectionPolicyType = policies::NoIndirection< RelationType::SetPosition, RelationType::SetElement > |
using | SubsettingPolicyType = policies::NoSubset |
using | ModularIntType = ModularInt< policies::RuntimeSize< RelationType::SetPosition > > |
using | PositionSet = OrderedSet< PositionType > |
using | const_iterator = OrderedSetIterator< ElementType, true > |
using | const_iterator_pair = std::pair< const_iterator, const_iterator > |
using | iterator = OrderedSetIterator< ElementType, false > |
using | iterator_pair = std::pair< iterator, iterator > |
using | IndirectionResult = RelationType::SetElement |
using | ConstIndirectionResult = const RelationType::SetElement |
using | IndirectionBufferType = struct { } |
using | ParentSetType = const Set<> |
Public Member Functions | |
RelationSet () | |
RelationSet (RelationType *relation) | |
Constructor taking in the relation this BivariateSet is based on. More... | |
PositionType | findElementIndex (PositionType pos1, PositionType pos2) const override |
Searches for the SparseIndex of the element given its DenseIndex. If the element (i,j) is the kth non-zero in the row, then findElementIndex(i,j) returns k . If element(i,j) does not exist (such as the case of a zero in a sparse matrix), then INVALID_POS is returned. More... | |
PositionType | findElementFlatIndex (PositionType s1, PositionType s2) const override |
Search for the FlatIndex of the element given its DenseIndex. More... | |
PositionType | findElementFlatIndex (PositionType pos1) const override |
Given the from-set index pos1, return the FlatIndex of the first existing to-set element in the relation pair, or INVALID_POS if this row contains no elements. More... | |
const OrderedSetType | getElements (PositionType s1) const override |
A set of elements with the given first set index. More... | |
ElementType | at (PositionType pos) const override |
RelationType * | getRelation () const |
Returns the relation pointer. More... | |
PositionType | totalSize () const |
Return the size of the relation. More... | |
PositionType | size (PositionType pos) const override |
Return the size of a row, which is the number of to-set elements associated with the given from-set index. More... | |
bool | isValid (bool verboseOutput=false) const override |
iterator | begin () |
const_iterator | begin () const |
iterator | end () |
const_iterator | end () const |
iterator_pair | range () |
const_iterator_pair | range () const |
policies::NoIndirection< RelationType::SetPosition, RelationType::SetElement > ::ConstIndirectionResult | operator[] (PositionType pos) const |
Given a position in the Set, return a position in the larger index space. More... | |
policies::NoIndirection< RelationType::SetPosition, RelationType::SetElement > ::IndirectionResult | operator[] (PositionType pos) |
ElementType | at (PositionType pos) const |
Random access to the entities of the set. More... | |
RelationType::SetPosition & | size () |
bool | empty () const |
Checks if there are any elements in the set – equivalent to: set.size() == 0. More... | |
bool | isValid (RelationType::SetPosition, RelationType::SetPosition, RelationType::SetPosition, bool) const |
template<typename OrderedSetIt > | |
bool | isValid (OrderedSetIt, OrderedSetIt, bool) const |
bool | isSubset () const |
Determines if the Set is a Subset of another set. More... | |
bool | isValidIndex (PositionType pos) const |
checks whether the given position (index) is valid. More... | |
PositionSet | positions () const |
returns a PositionSet over the set's positions More... | |
RelationType::SetPosition | operator() () const |
RelationType::SetPosition & | operator() () |
RelationType::SetPosition | operator() () const |
const RelationType::SetPosition | operator() () const |
IndirectionResult | operator() (RelationType::SetPosition pos) const |
RelationType::SetPosition | offset () const |
const RelationType::SetPosition | stride () const |
void | setStride (RelationType::SetPosition AXOM_DEBUG_PARAM(val)) |
IndirectionResult | indirection (RelationType::SetPosition pos) const |
IndirectionBufferType * | data () |
bool | hasIndirection () const |
const ParentSetType * | parentSet () const |
virtual PositionType | findElementIndex (PositionType pos1, PositionType pos2) const=0 |
Searches for the SparseIndex of the element given its DenseIndex. If the element (i,j) is the kth non-zero in the row, then findElementIndex(i,j) returns k . If element (i,j) does not exist (such as the case of a zero in a sparse matrix), then INVALID_POS is returned. More... | |
virtual PositionType | findElementFlatIndex (PositionType pos1, PositionType pos2) const=0 |
Search for the FlatIndex of the element given its DenseIndex. More... | |
virtual PositionType | findElementFlatIndex (PositionType pos1) const=0 |
Searches for the first existing element given the row index (first set position). More... | |
virtual PositionType | size (PositionType pos1) const=0 |
Number of elements of the BivariateSet whose first index is pos. More... | |
PositionType | firstSetSize () const |
Size of the first set. More... | |
PositionType | secondSetSize () const |
Size of the second set. More... | |
virtual const SetType * | getFirstSet () const |
Returns pointer to the first set. More... | |
virtual const SetType * | getSecondSet () const |
Returns pointer to the second set. More... | |
virtual ElementType | at (PositionType pos) const=0 |
Returns the element at the given FlatIndex pos. More... | |
virtual const OrderedSetType | getElements (PositionType s1) const=0 |
A set of elements with the given first set index. More... | |
virtual void | verifyPosition (PositionType s1, PositionType s2) const=0 |
Static Public Attributes | |
static const NullSet | s_nullSet |
static const PositionType | INVALID_POS |
static const NullSet< RelationType::SetPosition, RelationType::SetElement > | s_nullSet |
OrderedSet_Size_Policies | |
A few default policies for the size of an OrderedSet | |
static const RelationType::SetPosition | DEFAULT_VALUE |
OrderedSet_Offset_Policies | |
A few default policies for the offset of an OrderedSet | |
static const RelationType::SetPosition | DEFAULT_VALUE |
OrderedSet_Stride_Policies | |
A few default policies for the stride of an OrderedSet | |
static const RelationType::SetPosition | DEFAULT_VALUE |
Protected Attributes | |
RelationType::SetPosition | m_sz |
const SetType * | m_set1 |
const SetType * | m_set2 |
Models a Set whose elements are derived from a relation, one element per fromSet and toSet pair in the relation.
RelationSet models a subset of the Cartesian product of two sets. Users should refer to the BivariateSet documentation for descriptions of the different indexing names (SparseIndex, DenseIndex, FlatIndex).
using axom::slam::RelationSet< RelationType >::PositionType = typename RelationType::SetPosition |
using axom::slam::RelationSet< RelationType >::ElementType = typename RelationType::SetElement |
using axom::slam::RelationSet< RelationType >::RelationSubset = typename RelationType::RelationSubset |
using axom::slam::RelationSet< RelationType >::BivariateSetType = BivariateSet<PositionType, ElementType> |
using axom::slam::RelationSet< RelationType >::SetType = typename BivariateSetType::SetType |
using axom::slam::RelationSet< RelationType >::OrderedSetType = typename BivariateSetType::OrderedSetType |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inline |
|
inline |
Constructor taking in the relation this BivariateSet is based on.
References SLIC_ASSERT.
|
inlineoverride |
Searches for the SparseIndex of the element given its DenseIndex. If the element (i,j) is the kth non-zero in the row, then findElementIndex(i,j)
returns k
. If element(i,j)
does not exist (such as the case of a zero in a sparse matrix), then INVALID_POS
is returned.
pos1 | The first set position. |
pos2 | The second set position. |
References axom::slam::BivariateSet< RelationType::SetPosition, RelationType::SetElement >::INVALID_POS.
|
inlineoverride |
Search for the FlatIndex of the element given its DenseIndex.
pos1 | The first set position. |
pos2 | The second set position. |
References axom::slam::BivariateSet< RelationType::SetPosition, RelationType::SetElement >::INVALID_POS.
|
inlineoverride |
Given the from-set index pos1, return the FlatIndex of the first existing to-set element in the relation pair, or INVALID_POS
if this row contains no elements.
pos1 | Index into the from-set. |
pos2 | Index into the to-set. |
References axom::slam::BivariateSet< RelationType::SetPosition, RelationType::SetElement >::INVALID_POS.
|
inlineoverride |
A set of elements with the given first set index.
s1 | The first set index. |
|
inlineoverride |
|
inline |
Returns the relation pointer.
|
inline |
Return the size of the relation.
|
inlineoverride |
Return the size of a row, which is the number of to-set elements associated with the given from-set index.
pos | The from-set position. |
Referenced by axom::slam::RelationSet< RelationType >::isValid().
|
inlineoverridevirtual |
Reimplemented from axom::slam::BivariateSet< RelationType::SetPosition, RelationType::SetElement >.
References AXOM_DEBUG_PARAM, axom::slam::BivariateSet< RelationType::SetPosition, RelationType::SetElement >::firstSetSize(), axom::slam::BivariateSet< RelationType::SetPosition, RelationType::SetElement >::secondSetSize(), axom::slam::RelationSet< RelationType >::size(), and SLIC_ASSERT_MSG.
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
Given a position in the Set, return a position in the larger index space.
|
inlineinherited |
|
inlinevirtualinherited |
Random access to the entities of the set.
The | index of the desired element |
Implements axom::slam::Set< RelationType::SetPosition, RelationType::SetElement >.
|
inlineinherited |
|
inlinevirtualinherited |
Checks if there are any elements in the set – equivalent to: set.size() == 0.
Implements axom::slam::Set< RelationType::SetPosition, RelationType::SetElement >.
|
inlineinherited |
|
inlineinherited |
|
inlinevirtualinherited |
Determines if the Set is a Subset of another set.
Implements axom::slam::Set< RelationType::SetPosition, RelationType::SetElement >.
|
inlineinherited |
checks whether the given position (index) is valid.
An index pos is valid when \( 0 \le pos < size() \)
|
inlineinherited |
returns a PositionSet over the set's positions
This can be used to simplify code to loop through the elements of a set.
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
pure virtualinherited |
Searches for the SparseIndex of the element given its DenseIndex. If the element (i,j) is the kth non-zero in the row, then findElementIndex(i,j)
returns k
. If element (i,j)
does not exist (such as the case of a zero in a sparse matrix), then INVALID_POS
is returned.
pos1 | The first set position. |
pos2 | The second set position. |
|
pure virtualinherited |
Search for the FlatIndex of the element given its DenseIndex.
pos1 | The first set position. |
pos2 | The second set position. |
|
pure virtualinherited |
Searches for the first existing element given the row index (first set position).
pos1 | The first set position. |
|
pure virtualinherited |
Number of elements of the BivariateSet whose first index is pos.
|
inlineinherited |
Size of the first set.
References axom::slam::BivariateSet< PosType, ElemType >::m_set1, and axom::slam::Set< PosType, ElemType >::size().
Referenced by axom::slam::RelationSet< RelationType >::isValid().
|
inlineinherited |
Size of the second set.
References axom::slam::BivariateSet< PosType, ElemType >::m_set2, and axom::slam::Set< PosType, ElemType >::size().
Referenced by axom::slam::RelationSet< RelationType >::isValid().
|
inlinevirtualinherited |
Returns pointer to the first set.
References axom::slam::BivariateSet< PosType, ElemType >::m_set1.
|
inlinevirtualinherited |
Returns pointer to the second set.
References axom::slam::BivariateSet< PosType, ElemType >::at(), axom::slam::BivariateSet< PosType, ElemType >::getElements(), and axom::slam::BivariateSet< PosType, ElemType >::m_set2.
|
pure virtualinherited |
Returns the element at the given FlatIndex pos.
|
pure virtualinherited |
A set of elements with the given first set index.
s1 | The first set index. |
|
pure virtualinherited |
|
staticinherited |
|
staticinherited |
|
staticinherited |
|
protectedinherited |
|
staticinherited |
Referenced by axom::slam::policies::VirtualParentSubset::isSubset().
|
staticinherited |
|
staticinherited |
|
protectedinherited |
|
protectedinherited |