AXOM
Axom provides a robust, flexible software infrastructure for the development of multi-physics applications and computational tools.
axom::slam::ProductSet< SetType1, SetType2, InterfaceType > Class Template Referencefinal

Models a set whose element is the Cartesian product of two sets. The number of elements in this set is the product of the sizes of the two input sets. More...

#include </home/docs/checkouts/readthedocs.org/user_builds/axom/checkouts/latest/src/axom/slam/ProductSet.hpp>

Inherits policies::BivariateSetInterface< policies::VirtualInterface, slam::Set<>, slam::Set<> >.

Public Types

using RangeSetType = typename BaseType::RangeSetType
 
using FirstSetType = SetType1
 
using SecondSetType = SetType2
 
using PositionType = typename BaseType::PositionType
 
using ElementType = typename BaseType::ElementType
 
using ProductSetType = ProductSet< SetType1, SetType2 >
 
using IteratorType = BivariateSetIterator< ProductSet >
 
using ConcreteSet = ProductSet< SetType1, SetType2, policies::ConcreteInterface >
 
using VirtualSet = ProductSet< SetType1, SetType2, policies::VirtualInterface >
 
using OtherSet = std::conditional_t< std::is_same< InterfaceType, policies::VirtualInterface >::value, ConcreteSet, VirtualSet >
 
using SubsetType = typename RowSet< void, typename BaseType::SubsetType >::Type
 

Public Member Functions

 ProductSet (const OtherSet &other)
 
 ProductSet ()
 Default constructor. More...
 
 ProductSet (const FirstSetType *set1, const SecondSetType *set2)
 Constructor taking in pointers of two Sets. More...
 
PositionType findElementIndex (PositionType pos1, PositionType pos2) const
 Return the element SparseIndex. Since ProductSet is the full Cartesian product of the two sets, the SparseIndex is the same as its DenseIndex, which is the same as the pos2 parameter. More...
 
AXOM_HOST_DEVICE PositionType findElementFlatIndex (PositionType pos1, PositionType pos2) const
 Returns an element's FlatIndex given its DenseIndex. Since ProductSet is the full Cartesian product of the two sets, an element's FlatIndex is equal to pos1*secondSetSize()+pos2. More...
 
PositionType findElementFlatIndex (PositionType pos1) const
 Returns the FlatIndex of the first element in the specified row. This is equal to pos1*secondSetSize(). 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...
 
SubsetType getElements (PositionType AXOM_DEBUG_PARAM(pos1)) const
 Return all elements from the second set associated with position pos1 in the first set. More...
 
AXOM_HOST_DEVICE ElementType at (PositionType pos) const
 
AXOM_HOST_DEVICE PositionType size () const
 
PositionType size (PositionType) const
 
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...
 
AXOM_HOST_DEVICE RangeSetType elementRangeSet (PositionType pos1) const
 
bool isValidIndex (PositionType s1, PositionType s2) const
 
bool isValid (bool verboseOutput=false) const
 

Detailed Description

template<typename SetType1 = slam::Set<>, typename SetType2 = slam::Set<>, typename InterfaceType = policies::VirtualInterface>
class axom::slam::ProductSet< SetType1, SetType2, InterfaceType >

Models a set whose element is the Cartesian product of two sets. The number of elements in this set is the product of the sizes of the two input sets.

Users should refer to the BivariateSet documentation for descriptions of the different indexing names (SparseIndex, DenseIndex, FlatIndex).

See also
BivariateSet

Member Typedef Documentation

◆ RangeSetType

template<typename SetType1 = slam::Set<>, typename SetType2 = slam::Set<>, typename InterfaceType = policies::VirtualInterface>
using axom::slam::ProductSet< SetType1, SetType2, InterfaceType >::RangeSetType = typename BaseType::RangeSetType

◆ FirstSetType

template<typename SetType1 = slam::Set<>, typename SetType2 = slam::Set<>, typename InterfaceType = policies::VirtualInterface>
using axom::slam::ProductSet< SetType1, SetType2, InterfaceType >::FirstSetType = SetType1

◆ SecondSetType

template<typename SetType1 = slam::Set<>, typename SetType2 = slam::Set<>, typename InterfaceType = policies::VirtualInterface>
using axom::slam::ProductSet< SetType1, SetType2, InterfaceType >::SecondSetType = SetType2

◆ PositionType

template<typename SetType1 = slam::Set<>, typename SetType2 = slam::Set<>, typename InterfaceType = policies::VirtualInterface>
using axom::slam::ProductSet< SetType1, SetType2, InterfaceType >::PositionType = typename BaseType::PositionType

◆ ElementType

template<typename SetType1 = slam::Set<>, typename SetType2 = slam::Set<>, typename InterfaceType = policies::VirtualInterface>
using axom::slam::ProductSet< SetType1, SetType2, InterfaceType >::ElementType = typename BaseType::ElementType

◆ ProductSetType

template<typename SetType1 = slam::Set<>, typename SetType2 = slam::Set<>, typename InterfaceType = policies::VirtualInterface>
using axom::slam::ProductSet< SetType1, SetType2, InterfaceType >::ProductSetType = ProductSet<SetType1, SetType2>

◆ IteratorType

template<typename SetType1 = slam::Set<>, typename SetType2 = slam::Set<>, typename InterfaceType = policies::VirtualInterface>
using axom::slam::ProductSet< SetType1, SetType2, InterfaceType >::IteratorType = BivariateSetIterator<ProductSet>

◆ ConcreteSet

template<typename SetType1 = slam::Set<>, typename SetType2 = slam::Set<>, typename InterfaceType = policies::VirtualInterface>
using axom::slam::ProductSet< SetType1, SetType2, InterfaceType >::ConcreteSet = ProductSet<SetType1, SetType2, policies::ConcreteInterface>

◆ VirtualSet

template<typename SetType1 = slam::Set<>, typename SetType2 = slam::Set<>, typename InterfaceType = policies::VirtualInterface>
using axom::slam::ProductSet< SetType1, SetType2, InterfaceType >::VirtualSet = ProductSet<SetType1, SetType2, policies::VirtualInterface>

◆ OtherSet

template<typename SetType1 = slam::Set<>, typename SetType2 = slam::Set<>, typename InterfaceType = policies::VirtualInterface>
using axom::slam::ProductSet< SetType1, SetType2, InterfaceType >::OtherSet = std::conditional_t<std::is_same<InterfaceType, policies::VirtualInterface>::value, ConcreteSet, VirtualSet>

◆ SubsetType

template<typename SetType1 = slam::Set<>, typename SetType2 = slam::Set<>, typename InterfaceType = policies::VirtualInterface>
using axom::slam::ProductSet< SetType1, SetType2, InterfaceType >::SubsetType = typename RowSet<void, typename BaseType::SubsetType>::Type

Constructor & Destructor Documentation

◆ ProductSet() [1/3]

template<typename SetType1 = slam::Set<>, typename SetType2 = slam::Set<>, typename InterfaceType = policies::VirtualInterface>
axom::slam::ProductSet< SetType1, SetType2, InterfaceType >::ProductSet ( const OtherSet other)
inline

◆ ProductSet() [2/3]

template<typename SetType1 = slam::Set<>, typename SetType2 = slam::Set<>, typename InterfaceType = policies::VirtualInterface>
axom::slam::ProductSet< SetType1, SetType2, InterfaceType >::ProductSet ( )
inline

Default constructor.

◆ ProductSet() [3/3]

template<typename SetType1 = slam::Set<>, typename SetType2 = slam::Set<>, typename InterfaceType = policies::VirtualInterface>
axom::slam::ProductSet< SetType1, SetType2, InterfaceType >::ProductSet ( const FirstSetType set1,
const SecondSetType set2 
)
inline

Constructor taking in pointers of two Sets.

Parameters
set1Pointer to the first Set.
set2Pointer to the second Set.

Member Function Documentation

◆ findElementIndex()

template<typename SetType1 = slam::Set<>, typename SetType2 = slam::Set<>, typename InterfaceType = policies::VirtualInterface>
PositionType axom::slam::ProductSet< SetType1, SetType2, InterfaceType >::findElementIndex ( PositionType  pos1,
PositionType  pos2 
) const
inline

Return the element SparseIndex. Since ProductSet is the full Cartesian product of the two sets, the SparseIndex is the same as its DenseIndex, which is the same as the pos2 parameter.

Parameters
pos1The first set position.
pos2The second set position.
Returns
The element's SparseIndex, which is the same as pos2

◆ findElementFlatIndex() [1/2]

template<typename SetType1 = slam::Set<>, typename SetType2 = slam::Set<>, typename InterfaceType = policies::VirtualInterface>
AXOM_HOST_DEVICE PositionType axom::slam::ProductSet< SetType1, SetType2, InterfaceType >::findElementFlatIndex ( PositionType  pos1,
PositionType  pos2 
) const
inline

Returns an element's FlatIndex given its DenseIndex. Since ProductSet is the full Cartesian product of the two sets, an element's FlatIndex is equal to pos1*secondSetSize()+pos2.

Parameters
pos1The first set position.
pos2The second set position.
Returns
The element's FlatIndex.

◆ findElementFlatIndex() [2/2]

template<typename SetType1 = slam::Set<>, typename SetType2 = slam::Set<>, typename InterfaceType = policies::VirtualInterface>
PositionType axom::slam::ProductSet< SetType1, SetType2, InterfaceType >::findElementFlatIndex ( PositionType  pos1) const
inline

Returns the FlatIndex of the first element in the specified row. This is equal to pos1*secondSetSize().

Parameters
pos1The first set position that specifies the row.

References axom::slam::ProductSet< SetType1, SetType2, InterfaceType >::findElementFlatIndex().

◆ flatToSecondIndex()

template<typename SetType1 = slam::Set<>, typename SetType2 = slam::Set<>, typename InterfaceType = policies::VirtualInterface>
AXOM_HOST_DEVICE PositionType axom::slam::ProductSet< SetType1, SetType2, InterfaceType >::flatToSecondIndex ( PositionType  flatIndex) const
inline

Given the flat index, return the associated to-set index in the relation pair.

Parameters
flatIndexThe FlatIndex of the from-set/to-set pair.
Returns
pos2 The to-set index.

References axom::slam::ProductSet< SetType1, SetType2, InterfaceType >::size(), and SLIC_ASSERT.

◆ flatToFirstIndex()

template<typename SetType1 = slam::Set<>, typename SetType2 = slam::Set<>, typename InterfaceType = policies::VirtualInterface>
AXOM_HOST_DEVICE PositionType axom::slam::ProductSet< SetType1, SetType2, InterfaceType >::flatToFirstIndex ( PositionType  flatIndex) const
inline

Given the flat index, return the associated from-set index in the relation pair.

Parameters
flatIndexThe FlatIndex of the from-set/to-set pair.
Returns
pos1 The from-set index.

References axom::slam::ProductSet< SetType1, SetType2, InterfaceType >::size(), and SLIC_ASSERT.

◆ getElements()

template<typename SetType1 = slam::Set<>, typename SetType2 = slam::Set<>, typename InterfaceType = policies::VirtualInterface>
SubsetType axom::slam::ProductSet< SetType1, SetType2, InterfaceType >::getElements ( PositionType   AXOM_DEBUG_PARAMpos1) const
inline

Return all elements from the second set associated with position pos1 in the first set.

Parameters
pos1The first set position that specifies the row.
Returns
An OrderedSet of the elements in the row.

References SLIC_ASSERT.

◆ at()

template<typename SetType1 = slam::Set<>, typename SetType2 = slam::Set<>, typename InterfaceType = policies::VirtualInterface>
AXOM_HOST_DEVICE ElementType axom::slam::ProductSet< SetType1, SetType2, InterfaceType >::at ( PositionType  pos) const
inline

◆ size() [1/2]

template<typename SetType1 = slam::Set<>, typename SetType2 = slam::Set<>, typename InterfaceType = policies::VirtualInterface>
AXOM_HOST_DEVICE PositionType axom::slam::ProductSet< SetType1, SetType2, InterfaceType >::size ( ) const
inline

◆ size() [2/2]

template<typename SetType1 = slam::Set<>, typename SetType2 = slam::Set<>, typename InterfaceType = policies::VirtualInterface>
PositionType axom::slam::ProductSet< SetType1, SetType2, InterfaceType >::size ( PositionType  ) const
inline

◆ begin()

template<typename SetType1 = slam::Set<>, typename SetType2 = slam::Set<>, typename InterfaceType = policies::VirtualInterface>
IteratorType axom::slam::ProductSet< SetType1, SetType2, InterfaceType >::begin ( ) const
inline

Return an iterator to the first pair of set elements in the relation.

◆ end()

template<typename SetType1 = slam::Set<>, typename SetType2 = slam::Set<>, typename InterfaceType = policies::VirtualInterface>
IteratorType axom::slam::ProductSet< SetType1, SetType2, InterfaceType >::end ( ) const
inline

Return an iterator to one past the last pair of set elements in the relation.

References axom::slam::ProductSet< SetType1, SetType2, InterfaceType >::size().

◆ elementRangeSet()

template<typename SetType1 = slam::Set<>, typename SetType2 = slam::Set<>, typename InterfaceType = policies::VirtualInterface>
AXOM_HOST_DEVICE RangeSetType axom::slam::ProductSet< SetType1, SetType2, InterfaceType >::elementRangeSet ( PositionType  pos1) const
inline

◆ isValidIndex()

template<typename SetType1 = slam::Set<>, typename SetType2 = slam::Set<>, typename InterfaceType = policies::VirtualInterface>
bool axom::slam::ProductSet< SetType1, SetType2, InterfaceType >::isValidIndex ( PositionType  s1,
PositionType  s2 
) const
inline

◆ isValid()

template<typename SetType1 = slam::Set<>, typename SetType2 = slam::Set<>, typename InterfaceType = policies::VirtualInterface>
bool axom::slam::ProductSet< SetType1, SetType2, InterfaceType >::isValid ( bool  verboseOutput = false) const
inline

The documentation for this class was generated from the following file: