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/latest/src/axom/slam/RelationSet.hpp>
Inherits policies::BivariateSetInterface< policies::VirtualInterface, typename Relation::FromSetType, typename Relation::ToSetType >.
|
using | FirstSetType = SetType1 |
|
using | SecondSetType = SetType2 |
|
using | RelationType = Relation |
|
using | PositionType = typename RelationType::SetPosition |
|
using | ElementType = typename RelationType::SetElement |
|
using | RelationSubset = typename RelationType::RelationSubset |
|
using | SubsetType = std::conditional_t< std::is_same< void, BaseSubsetType >::value, RelationSubset, BaseSubsetType > |
|
using | IteratorType = BivariateSetIterator< RelationSet > |
|
using | ConcreteSet = RelationSet< Relation, SetType1, SetType2, policies::ConcreteInterface > |
|
using | VirtualSet = RelationSet< Relation, SetType1, SetType2, policies::VirtualInterface > |
|
using | OtherSet = std::conditional_t< std::is_same< InterfaceType, policies::VirtualInterface >::value, ConcreteSet, VirtualSet > |
|
|
| RelationSet (const OtherSet &other) |
|
| RelationSet ()=default |
|
| RelationSet (RelationType *relation) |
| Constructor taking in the relation this BivariateSet is based on. More...
|
|
PositionType | findElementIndex (PositionType pos1, PositionType pos2) const |
| Searches for the SparseIndex of the element given its DenseIndex. \detail 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...
|
|
AXOM_HOST_DEVICE PositionType | findElementFlatIndex (PositionType s1, PositionType s2) const |
| Search for the FlatIndex of the element given its DenseIndex. More...
|
|
PositionType | findElementFlatIndex (PositionType pos1) const |
| 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...
|
|
AXOM_HOST_DEVICE PositionType | flatToSecondIndex (PositionType flatIndex) const |
| Given the flat index, return the associated to-set index in the relation pair. More...
|
|
AXOM_HOST_DEVICE PositionType | flatToFirstIndex (PositionType flatIndex) const |
| Given the flat index, return the associated from-set index in the relation pair. More...
|
|
AXOM_HOST_DEVICE RangeSetType | elementRangeSet (PositionType pos1) const |
|
SubsetType | getElements (PositionType s1) const |
| A set of elements with the given first set index. More...
|
|
AXOM_HOST_DEVICE ElementType | at (PositionType pos) const |
|
RelationType * | getRelation () const |
| Returns the relation pointer
More...
|
|
RelationType * | getRelation () |
|
PositionType | totalSize () const |
| Return the size of the relation
More...
|
|
PositionType | size (PositionType pos) const |
| Return the size of a row, which is the number of to-set elements associated with the given from-set index. More...
|
|
IteratorType | begin () const |
| Return an iterator to the first pair of set elements in the relation. More...
|
|
IteratorType | end () const |
| Return an iterator to one past the last pair of set elements in the relation. More...
|
|
bool | isValid (bool verboseOutput=false) const |
|
AXOM_HOST_DEVICE PositionType | size () const |
|
template<typename Relation, typename SetType1 = typename Relation::FromSetType, typename SetType2 = typename Relation::ToSetType, typename InterfaceType = policies::VirtualInterface>
class axom::slam::RelationSet< Relation, SetType1, SetType2, InterfaceType >
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).
- Template Parameters
-
- See also
- BivariateSet
◆ FirstSetType
template<typename Relation , typename SetType1 = typename Relation::FromSetType, typename SetType2 = typename Relation::ToSetType, typename InterfaceType = policies::VirtualInterface>
◆ SecondSetType
template<typename Relation , typename SetType1 = typename Relation::FromSetType, typename SetType2 = typename Relation::ToSetType, typename InterfaceType = policies::VirtualInterface>
◆ RelationType
template<typename Relation , typename SetType1 = typename Relation::FromSetType, typename SetType2 = typename Relation::ToSetType, typename InterfaceType = policies::VirtualInterface>
◆ PositionType
template<typename Relation , typename SetType1 = typename Relation::FromSetType, typename SetType2 = typename Relation::ToSetType, typename InterfaceType = policies::VirtualInterface>
◆ ElementType
template<typename Relation , typename SetType1 = typename Relation::FromSetType, typename SetType2 = typename Relation::ToSetType, typename InterfaceType = policies::VirtualInterface>
◆ RelationSubset
template<typename Relation , typename SetType1 = typename Relation::FromSetType, typename SetType2 = typename Relation::ToSetType, typename InterfaceType = policies::VirtualInterface>
◆ SubsetType
template<typename Relation , typename SetType1 = typename Relation::FromSetType, typename SetType2 = typename Relation::ToSetType, typename InterfaceType = policies::VirtualInterface>
◆ IteratorType
template<typename Relation , typename SetType1 = typename Relation::FromSetType, typename SetType2 = typename Relation::ToSetType, typename InterfaceType = policies::VirtualInterface>
◆ ConcreteSet
template<typename Relation , typename SetType1 = typename Relation::FromSetType, typename SetType2 = typename Relation::ToSetType, typename InterfaceType = policies::VirtualInterface>
◆ VirtualSet
template<typename Relation , typename SetType1 = typename Relation::FromSetType, typename SetType2 = typename Relation::ToSetType, typename InterfaceType = policies::VirtualInterface>
◆ OtherSet
template<typename Relation , typename SetType1 = typename Relation::FromSetType, typename SetType2 = typename Relation::ToSetType, typename InterfaceType = policies::VirtualInterface>
◆ RelationSet() [1/3]
template<typename Relation , typename SetType1 = typename Relation::FromSetType, typename SetType2 = typename Relation::ToSetType, typename InterfaceType = policies::VirtualInterface>
◆ RelationSet() [2/3]
template<typename Relation , typename SetType1 = typename Relation::FromSetType, typename SetType2 = typename Relation::ToSetType, typename InterfaceType = policies::VirtualInterface>
◆ RelationSet() [3/3]
template<typename Relation , typename SetType1 = typename Relation::FromSetType, typename SetType2 = typename Relation::ToSetType, typename InterfaceType = policies::VirtualInterface>
Constructor taking in the relation this BivariateSet is based on.
- Precondition
- relation pointer must not be a null pointer
References SLIC_ASSERT.
◆ findElementIndex()
template<typename Relation , typename SetType1 = typename Relation::FromSetType, typename SetType2 = typename Relation::ToSetType, typename InterfaceType = policies::VirtualInterface>
Searches for the SparseIndex of the element given its DenseIndex. \detail 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.
- Warning
- This function can be slow, since a linear search is performed on the row each time.
- Parameters
-
pos1 | The first set position. |
pos2 | The second set position. |
- Returns
- The DenseIndex of the given element, or INVALID_POS if such element is missing from the set.
- Precondition
- 0 <= pos1 <= set1.size() && 0 <= pos2 <= size2.size()
◆ findElementFlatIndex() [1/2]
template<typename Relation , typename SetType1 = typename Relation::FromSetType, typename SetType2 = typename Relation::ToSetType, typename InterfaceType = policies::VirtualInterface>
Search for the FlatIndex of the element given its DenseIndex.
- Warning
- This function can be slow, since a linear search is performed on the row each time.
- Parameters
-
pos1 | The first set position. |
pos2 | The second set position. |
- Returns
- The element's FlatIndex
- Precondition
- 0 <= pos1 <= set1.size() && 0 <= pos2 <= size2.size()
◆ findElementFlatIndex() [2/2]
template<typename Relation , typename SetType1 = typename Relation::FromSetType, typename SetType2 = typename Relation::ToSetType, typename InterfaceType = policies::VirtualInterface>
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.
- Parameters
-
pos1 | Index into the from-set. |
pos2 | Index into the to-set. |
- Returns
- The FlatIndex of the first existing to-set element.
◆ flatToSecondIndex()
template<typename Relation , typename SetType1 = typename Relation::FromSetType, typename SetType2 = typename Relation::ToSetType, typename InterfaceType = policies::VirtualInterface>
◆ flatToFirstIndex()
template<typename Relation , typename SetType1 = typename Relation::FromSetType, typename SetType2 = typename Relation::ToSetType, typename InterfaceType = policies::VirtualInterface>
◆ elementRangeSet()
template<typename Relation , typename SetType1 = typename Relation::FromSetType, typename SetType2 = typename Relation::ToSetType, typename InterfaceType = policies::VirtualInterface>
◆ getElements()
template<typename Relation , typename SetType1 = typename Relation::FromSetType, typename SetType2 = typename Relation::ToSetType, typename InterfaceType = policies::VirtualInterface>
A set of elements with the given first set index.
- Parameters
-
- Returns
- An OrderedSet containing the elements in the row.
- Precondition
- 0 <= pos1 <= set1.size()
◆ at()
template<typename Relation , typename SetType1 = typename Relation::FromSetType, typename SetType2 = typename Relation::ToSetType, typename InterfaceType = policies::VirtualInterface>
◆ getRelation() [1/2]
template<typename Relation , typename SetType1 = typename Relation::FromSetType, typename SetType2 = typename Relation::ToSetType, typename InterfaceType = policies::VirtualInterface>
Returns the relation pointer
◆ getRelation() [2/2]
template<typename Relation , typename SetType1 = typename Relation::FromSetType, typename SetType2 = typename Relation::ToSetType, typename InterfaceType = policies::VirtualInterface>
◆ totalSize()
template<typename Relation , typename SetType1 = typename Relation::FromSetType, typename SetType2 = typename Relation::ToSetType, typename InterfaceType = policies::VirtualInterface>
◆ size() [1/2]
template<typename Relation , typename SetType1 = typename Relation::FromSetType, typename SetType2 = typename Relation::ToSetType, typename InterfaceType = policies::VirtualInterface>
◆ begin()
template<typename Relation , typename SetType1 = typename Relation::FromSetType, typename SetType2 = typename Relation::ToSetType, typename InterfaceType = policies::VirtualInterface>
Return an iterator to the first pair of set elements in the relation.
◆ end()
template<typename Relation , typename SetType1 = typename Relation::FromSetType, typename SetType2 = typename Relation::ToSetType, typename InterfaceType = policies::VirtualInterface>
◆ isValid()
template<typename Relation , typename SetType1 = typename Relation::FromSetType, typename SetType2 = typename Relation::ToSetType, typename InterfaceType = policies::VirtualInterface>
◆ size() [2/2]
template<typename Relation , typename SetType1 = typename Relation::FromSetType, typename SetType2 = typename Relation::ToSetType, typename InterfaceType = policies::VirtualInterface>
The documentation for this class was generated from the following file:
- /home/docs/checkouts/readthedocs.org/user_builds/axom/checkouts/latest/src/axom/slam/RelationSet.hpp