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.5.0/src/axom/slam/ProductSet.hpp>
Public Types | |
using | BivariateSetType = BivariateSet< PosType, ElemType > |
using | PositionType = typename BivariateSetType::PositionType |
using | ElementType = typename BivariateSetType::ElementType |
using | SetType = typename BivariateSetType::SetType |
using | OrderedSetType = typename BivariateSetType::OrderedSetType |
using | RangeSetType = RangeSet< PosType, ElemType > |
Public Member Functions | |
ProductSet () | |
Default constructor. More... | |
ProductSet (SetType *set1, SetType *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 |
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 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 PositionType | INVALID_POS = PositionType(-1) |
static const NullSet< PosType, ElemType > | s_nullSet |
Protected Attributes | |
const SetType * | m_set1 |
const SetType * | m_set2 |
Private Types | |
using | SizePolicyType = policies::RuntimeSize< PosType > |
using | OffsetPolicyType = policies::RuntimeOffset< PosType > |
using | StridePolicyType = policies::StrideOne< PosType > |
using | IndirectionPolicyType = policies::NoIndirection< PosType, ElemType > |
using | SubsettingPolicyType = policies::NoSubset |
using | ModularIntType = ModularInt< policies::RuntimeSize< PosType > > |
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 = ElemType |
using | ConstIndirectionResult = const ElemType |
using | IndirectionBufferType = struct { } |
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< PosType, ElemType > ::ConstIndirectionResult | operator[] (PositionType pos) const |
Given a position in the Set, return a position in the larger index space. More... | |
policies::NoIndirection< PosType, ElemType > ::IndirectionResult | operator[] (PositionType pos) |
ElementType | at (PositionType pos) const |
Random access to the entities of the set. More... | |
PosType & | size () |
bool | empty () const |
Checks if there are any elements in the set – equivalent to: set.size() == 0. More... | |
bool | isValid (PosType, PosType, PosType, 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... | |
PosType | operator() () const |
PosType & | operator() () |
PosType | operator() () const |
PosType & | operator() () |
const PosType | operator() () const |
IndirectionResult | operator() (PosType pos) const |
PosType | offset () const |
PosType & | offset () |
const PosType | stride () const |
void | setStride (PosType AXOM_DEBUG_PARAM(val)) |
IndirectionResult | indirection (PosType pos) const |
IndirectionBufferType * | data () |
bool | hasIndirection () const |
const ParentSetType * | parentSet () const |
Private Attributes | |
PosType | m_sz |
Static Private Attributes | |
static const NullSet | s_nullSet |
OrderedSet_Size_Policies | |
A few default policies for the size of an OrderedSet | |
static const PosType | DEFAULT_VALUE |
OrderedSet_Offset_Policies | |
A few default policies for the offset of an OrderedSet | |
static const PosType | DEFAULT_VALUE |
OrderedSet_Stride_Policies | |
A few default policies for the stride of an OrderedSet | |
static const PosType | 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< PosType, ElemType >::BivariateSetType = BivariateSet<PosType, ElemType> |
using axom::slam::ProductSet< PosType, ElemType >::PositionType = typename BivariateSetType::PositionType |
using axom::slam::ProductSet< PosType, ElemType >::ElementType = typename BivariateSetType::ElementType |
using axom::slam::ProductSet< PosType, ElemType >::SetType = typename BivariateSetType::SetType |
using axom::slam::ProductSet< PosType, ElemType >::OrderedSetType = typename BivariateSetType::OrderedSetType |
using axom::slam::ProductSet< PosType, ElemType >::RangeSetType = RangeSet<PosType, ElemType> |
|
inline |
Default constructor.
|
inline |
Constructor taking in pointers of two Sets.
References axom::slam::BivariateSet< PosType, ElemType >::secondSetSize(), and axom::slam::OrderedSet< PosType, ElemType, SizePolicy, OffsetPolicy, StridePolicy, IndirectionPolicy, SubsettingPolicy >::size().
|
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. |
References axom::slam::ProductSet< PosType, ElemType >::isValidIndex().
|
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::ProductSet< PosType, ElemType >::isValidIndex(), and axom::slam::BivariateSet< PosType, ElemType >::secondSetSize().
Referenced by axom::slam::ProductSet< PosType, ElemType >::findElementFlatIndex().
|
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< PosType, ElemType >::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< PosType, ElemType >::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< PosType, ElemType >.
References axom::slam::BivariateSet< PosType, ElemType >::firstSetSize(), and axom::slam::BivariateSet< PosType, ElemType >::secondSetSize().
Referenced by axom::slam::ProductSet< PosType, ElemType >::isValid().
|
inlineoverride |
|
inline |
References axom::slam::BivariateSet< PosType, ElemType >::firstSetSize(), and axom::slam::BivariateSet< PosType, ElemType >::secondSetSize().
Referenced by axom::slam::ProductSet< PosType, ElemType >::findElementFlatIndex(), axom::slam::ProductSet< PosType, ElemType >::findElementIndex(), and axom::slam::ProductSet< PosType, ElemType >::isValid().
|
inlineoverridevirtual |
Reimplemented from axom::slam::BivariateSet< PosType, ElemType >.
References AXOM_DEBUG_PARAM, axom::slam::BivariateSet< PosType, ElemType >::firstSetSize(), axom::slam::BivariateSet< PosType, ElemType >::isValid(), axom::slam::OrderedSet< PosType, ElemType, policies::RuntimeSize< PosType >, policies::RuntimeOffset< PosType >, policies::StrideOne< PosType >, policies::NoIndirection< PosType, ElemType >, policies::NoSubset >::isValid(), axom::slam::ProductSet< PosType, ElemType >::isValidIndex(), axom::slam::BivariateSet< PosType, ElemType >::secondSetSize(), axom::slam::ProductSet< PosType, ElemType >::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. |
Implemented in axom::slam::NullBivariateSet< PosType, ElemType >, and axom::slam::NullBivariateSet< SetPosition, SetElement >.
Referenced by axom::slam::BivariateSet< RelationType::SetPosition, RelationType::SetElement >::BivariateSet(), and axom::slam::BivariateMap< SetType, DataType, StridePolicy >::index().
|
pure virtualinherited |
Search for the FlatIndex of the element given its DenseIndex.
pos1 | The first set position. |
pos2 | The second set position. |
Implemented in axom::slam::NullBivariateSet< PosType, ElemType >, and axom::slam::NullBivariateSet< SetPosition, SetElement >.
Referenced by axom::slam::BivariateSet< RelationType::SetPosition, RelationType::SetElement >::BivariateSet(), axom::slam::NullBivariateSet< SetPosition, SetElement >::findElementFlatIndex(), axom::slam::BivariateMap< SetType, DataType, StridePolicy >::findValue(), axom::slam::BivariateMap< SetType, DataType, StridePolicy >::flatIndex(), axom::slam::BivariateMap< SetType, DataType, StridePolicy >::operator()(), and axom::slam::BivariateMap< SetType, DataType, StridePolicy >::operator[]().
|
pure virtualinherited |
Searches for the first existing element given the row index (first set position).
pos1 | The first set position. |
Implemented in axom::slam::NullBivariateSet< PosType, ElemType >, and axom::slam::NullBivariateSet< SetPosition, SetElement >.
|
pure virtualinherited |
Number of elements of the BivariateSet whose first index is pos.
Implemented in axom::slam::NullBivariateSet< PosType, ElemType >, and axom::slam::NullBivariateSet< SetPosition, SetElement >.
|
inlineinherited |
|
inlineinherited |
Size of the second set.
Referenced by axom::slam::ProductSet< PosType, ElemType >::at(), axom::slam::ProductSet< PosType, ElemType >::findElementFlatIndex(), axom::slam::ProductSet< PosType, ElemType >::isValid(), axom::slam::ProductSet< PosType, ElemType >::isValidIndex(), axom::slam::ProductSet< PosType, ElemType >::ProductSet(), and axom::slam::ProductSet< PosType, ElemType >::size().
|
inlinevirtualinherited |
Returns pointer to the first set.
|
inlinevirtualinherited |
Returns pointer to the second set.
|
pure virtualinherited |
Returns the element at the given FlatIndex pos.
Implemented in axom::slam::NullBivariateSet< PosType, ElemType >, and axom::slam::NullBivariateSet< SetPosition, SetElement >.
Referenced by axom::slam::BivariateSet< RelationType::SetPosition, RelationType::SetElement >::getSecondSet(), axom::slam::BivariateMap< SetType, DataType, StridePolicy >::BivariateMapIterator::numComp(), and axom::slam::BivariateMap< SetType, DataType, StridePolicy >::BivariateMapIterator::secondIndex().
|
pure virtualinherited |
A set of elements with the given first set index.
s1 | The first set index. |
Implemented in axom::slam::NullBivariateSet< PosType, ElemType >, and axom::slam::NullBivariateSet< SetPosition, SetElement >.
Referenced by axom::slam::BivariateSet< RelationType::SetPosition, RelationType::SetElement >::getSecondSet(), and axom::slam::BivariateMap< SetType, DataType, StridePolicy >::indexSet().
|
pure virtualinherited |
Referenced by axom::slam::NullBivariateSet< SetPosition, SetElement >::findElementFlatIndex(), axom::slam::NullBivariateSet< SetPosition, SetElement >::findElementIndex(), axom::slam::NullBivariateSet< SetPosition, SetElement >::getElements(), and axom::slam::BivariateSet< RelationType::SetPosition, RelationType::SetElement >::isValid().
|
staticinherited |
|
staticinherited |
|
protectedinherited |
Referenced by axom::slam::BivariateSet< RelationType::SetPosition, RelationType::SetElement >::firstSetSize(), axom::slam::BivariateSet< RelationType::SetPosition, RelationType::SetElement >::getFirstSet(), and axom::slam::BivariateSet< RelationType::SetPosition, RelationType::SetElement >::isValid().
|
protectedinherited |
Referenced by axom::slam::BivariateSet< RelationType::SetPosition, RelationType::SetElement >::getSecondSet(), axom::slam::BivariateSet< RelationType::SetPosition, RelationType::SetElement >::isValid(), and axom::slam::BivariateSet< RelationType::SetPosition, RelationType::SetElement >::secondSetSize().