AXOM
Axom provides a robust, flexible software infrastructure for the development of multi-physics applications and computational tools.
|
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/v0.7.0/src/axom/slam/ProductSet.hpp>
Public Types | |
using | RangeSetType = RangeSet< typename SetType1::PositionType, typename SetType1::ElementType > |
using | FirstSetType = SetType1 |
using | SecondSetType = SetType2 |
using | BivariateSetType = BivariateSet< FirstSetType, SecondSetType > |
using | PositionType = typename BivariateSetType::PositionType |
using | ElementType = typename BivariateSetType::ElementType |
using | OrderedSetType = typename BivariateSetType::OrderedSetType |
using | ProductSetType = ProductSet< SetType1, SetType2 > |
using | NullSetType = NullSet< PositionType, ElementType > |
Public Member Functions | |
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 override |
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... | |
PositionType | findElementFlatIndex (PositionType pos1, PositionType pos2) const override |
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 override |
Returns the FlatIndex of the first element in the specified row. This is equal to pos1*secondSetSize() . More... | |
const OrderedSetType | getElements (PositionType AXOM_DEBUG_PARAM(pos1)) const override |
Return all elements from the second set associated with position pos1 in the first set. More... | |
ElementType | at (PositionType pos) const override |
PositionType | size () const override |
Size of the BivariateSet, which is the number of non-zero entries in the BivariateSet. More... | |
PositionType | size (PositionType) const override |
RangeSetType | elementRangeSet (PositionType pos1) const override |
bool | isValidIndex (PositionType s1, PositionType s2) const |
bool | isValid (bool verboseOutput=false) const override |
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 RangeSetType | elementRangeSet (PositionType pos1) const=0 |
Finds the range of indices of valid elements in the second set, given the index of an element in the first set. 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... | |
const FirstSetType * | getFirstSet () const |
Returns pointer to the first set. More... | |
const SecondSetType * | 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 PositionType | INVALID_POS |
static const NullSetType | s_nullSet |
Protected Attributes | |
const FirstSetType * | m_set1 |
const SecondSetType * | m_set2 |
Private Types | |
using | SizePolicyType = policies::RuntimeSize< SetType1::PositionType > |
using | OffsetPolicyType = policies::RuntimeOffset< SetType1::PositionType > |
using | StridePolicyType = policies::StrideOne< SetType1::PositionType > |
using | IndirectionPolicyType = policies::NoIndirection< SetType1::PositionType, SetType1::ElementType > |
using | SubsettingPolicyType = policies::NoSubset |
using | ModularIntType = ModularInt< policies::RuntimeSize< SetType1::PositionType > > |
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 = SetType1::ElementType |
using | ConstIndirectionResult = const SetType1::ElementType |
using | IndirectionBufferType = struct { } |
using | IndirectionPtrType = IndirectionBufferType * |
using | ParentSetType = const Set<> |
Private Member Functions | |
iterator | begin () |
const_iterator | begin () const |
iterator | end () |
const_iterator | end () const |
iterator_pair | range () |
const_iterator_pair | range () const |
policies::NoIndirection< SetType1::PositionType, SetType1::ElementType > ::ConstIndirectionResult | operator[] (PositionType pos) const |
Given a position in the Set, return a position in the larger index space. More... | |
policies::NoIndirection< SetType1::PositionType, SetType1::ElementType > ::IndirectionResult | operator[] (PositionType pos) |
ElementType | at (PositionType pos) const |
Random access to the entities of the set. More... | |
SetType1::PositionType & | size () |
bool | empty () const |
Checks if there are any elements in the set – equivalent to: set.size() == 0. More... | |
bool | isValid (SetType1::PositionType, SetType1::PositionType, SetType1::PositionType, 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... | |
SetType1::PositionType | operator() () const |
SetType1::PositionType & | operator() () |
SetType1::PositionType | operator() () const |
SetType1::PositionType & | operator() () |
const SetType1::PositionType | operator() () const |
IndirectionResult | operator() (SetType1::PositionType pos) const |
SetType1::PositionType | offset () const |
SetType1::PositionType & | offset () |
const SetType1::PositionType | stride () const |
void | setStride (SetType1::PositionType AXOM_DEBUG_PARAM(val)) |
IndirectionResult | indirection (SetType1::PositionType pos) const |
IndirectionBufferType * | data () |
bool | hasIndirection () const |
const ParentSetType * | parentSet () const |
Private Attributes | |
SetType1::PositionType | m_sz |
Static Private Attributes | |
static const bool | IS_COMPILE_TIME |
static AXOM_EXPORT const NullSet | s_nullSet |
OrderedSet_Size_Policies | |
A few default policies for the size of an OrderedSet | |
static const SetType1::PositionType | DEFAULT_VALUE |
OrderedSet_Offset_Policies | |
A few default policies for the offset of an OrderedSet | |
static const SetType1::PositionType | DEFAULT_VALUE |
OrderedSet_Stride_Policies | |
A few default policies for the stride of an OrderedSet | |
static const SetType1::PositionType | DEFAULT_VALUE |
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).
using axom::slam::ProductSet< SetType1, SetType2 >::RangeSetType = RangeSet<typename SetType1::PositionType, typename SetType1::ElementType> |
using axom::slam::ProductSet< SetType1, SetType2 >::FirstSetType = SetType1 |
using axom::slam::ProductSet< SetType1, SetType2 >::SecondSetType = SetType2 |
using axom::slam::ProductSet< SetType1, SetType2 >::BivariateSetType = BivariateSet<FirstSetType, SecondSetType> |
using axom::slam::ProductSet< SetType1, SetType2 >::PositionType = typename BivariateSetType::PositionType |
using axom::slam::ProductSet< SetType1, SetType2 >::ElementType = typename BivariateSetType::ElementType |
using axom::slam::ProductSet< SetType1, SetType2 >::OrderedSetType = typename BivariateSetType::OrderedSetType |
using axom::slam::ProductSet< SetType1, SetType2 >::ProductSetType = ProductSet<SetType1, SetType2> |
|
inherited |
|
inline |
Default constructor.
|
inline |
Constructor taking in pointers of two Sets.
References axom::slam::BivariateSet< SetType1, SetType2 >::secondSetSize().
|
inlineoverride |
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.
pos1 | The first set position. |
pos2 | The second set position. |
|
inlineoverride |
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
.
pos1 | The first set position. |
pos2 | The second set position. |
References axom::slam::BivariateSet< SetType1, SetType2 >::secondSetSize().
|
inlineoverride |
Returns the FlatIndex of the first element in the specified row. This is equal to pos1*secondSetSize()
.
pos1 | The first set position that specifies the row. |
References axom::slam::ProductSet< SetType1, SetType2 >::findElementFlatIndex().
|
inlineoverride |
Return all elements from the second set associated with position pos1 in the first set.
pos1 | The first set position that specifies the row. |
References axom::slam::BivariateSet< SetType1, SetType2 >::firstSetSize(), and SLIC_ASSERT.
|
inlineoverride |
|
inlineoverridevirtual |
Size of the BivariateSet, which is the number of non-zero entries in the BivariateSet.
Implements axom::slam::BivariateSet< SetType1, SetType2 >.
References axom::slam::BivariateSet< SetType1, SetType2 >::firstSetSize(), and axom::slam::BivariateSet< SetType1, SetType2 >::secondSetSize().
|
inlineoverride |
|
inlineoverride |
|
inline |
|
inlineoverridevirtual |
Reimplemented from axom::slam::BivariateSet< SetType1, SetType2 >.
References AXOM_DEBUG_PARAM, axom::slam::BivariateSet< SetType1, SetType2 >::firstSetSize(), axom::slam::BivariateSet< Set1, Set2 >::isValid(), axom::slam::OrderedSet< P, E, policies::RuntimeSize< P >, policies::RuntimeOffset< P >, policies::StrideOne< P >, policies::NoIndirection< P, E >, policies::NoSubset >::isValid(), axom::slam::ProductSet< SetType1, SetType2 >::isValidIndex(), axom::slam::BivariateSet< SetType1, SetType2 >::secondSetSize(), axom::slam::ProductSet< SetType1, SetType2 >::size(), and SLIC_ASSERT_MSG.
|
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 |
Finds the range of indices of valid elements in the second set, given the index of an element in the first set.
Position | of the element in the first set |
|
pure virtualinherited |
Number of elements of the BivariateSet whose first index is pos.
|
inlineinherited |
Size of the first set.
References axom::slam::BivariateSet< Set1, Set2 >::m_set1.
|
inlineinherited |
Size of the second set.
References axom::slam::BivariateSet< Set1, Set2 >::m_set2.
|
inlineinherited |
Returns pointer to the first set.
References axom::slam::BivariateSet< Set1, Set2 >::m_set1.
|
inlineinherited |
Returns pointer to the second set.
References axom::slam::BivariateSet< Set1, Set2 >::at(), axom::slam::BivariateSet< Set1, Set2 >::getElements(), axom::slam::BivariateSet< Set1, Set2 >::isValid(), axom::slam::BivariateSet< Set1, Set2 >::m_set2, SLIC_ASSERT_MSG, and axom::slam::BivariateSet< Set1, Set2 >::verifyPosition().
|
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 |
|
protectedinherited |
|
protectedinherited |