AXOM
Axom provides a robust, flexible software infrastructure for the development of multi-physics applications and computational tools.
|
Abstract class that models a set whose elements are indexed by two indices. Each element in a BivariateSet is equivalent to an ordered pair containing a row and column index, similar to indexing in a matrix. More...
#include </home/docs/checkouts/readthedocs.org/user_builds/axom/checkouts/v0.5.0/src/axom/slam/BivariateSet.hpp>
Public Types | |
using | PositionType = PosType |
using | ElementType = ElemType |
using | SetType = Set< PositionType, ElementType > |
using | OrderedSetType = OrderedSet< PositionType, ElementType, policies::RuntimeSize< PositionType >, policies::RuntimeOffset< PositionType >, policies::StrideOne< PositionType >, policies::STLVectorIndirection< PositionType, ElementType > > |
Public Member Functions | |
BivariateSet (const SetType *set1=&s_nullSet, const SetType *set2=&s_nullSet) | |
Constructor taking pointers to the two sets that defines the range of the indices of the BivariateSet. More... | |
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 () const =0 |
Size of the BivariateSet, which is the number of non-zero entries in the BivariateSet. 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 bool | isValid (bool verboseOutput=false) const |
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 |
Abstract class that models a set whose elements are indexed by two indices. Each element in a BivariateSet is equivalent to an ordered pair containing a row and column index, similar to indexing in a matrix.
BivariateSet models a subset of the Cartesian product of its two sets. Elements of a BivariateSet can be represented as an ordered pair of indices into the two sets.
For BivariateSets that do not model the entire Cartesian product, indices can be relative to the element positions in the original sets (in which case, we refer to them as a "DenseIndex"), or relative to the number of encoded indices, in which case we refer to them as a "SparseIndex". If we consider all the elements of a BivariateSet, we refer to this index space as the "FlatIndex".
For example, a 2 x 4 sparse matrix below:
Access the elements using DenseIndex (i,j)
would be...
(i = 0, j = 0) = a
(i = 0, j = 2) = b
(i = 1, j = 1) = c
(i = 1, j = 3) = d
Using SparseIndex (i,k)
...
(i = 0, k = 0) = a
(i = 0, k = 1) = b
(i = 1, k = 0) = c
(i = 1, k = 1) = d
Using FlatIndex [idx]
...
[idx = 0] = a
[idx = 1] = b
[idx = 2] = c
[idx = 3] = d
using axom::slam::BivariateSet< PosType, ElemType >::PositionType = PosType |
using axom::slam::BivariateSet< PosType, ElemType >::ElementType = ElemType |
using axom::slam::BivariateSet< PosType, ElemType >::SetType = Set<PositionType, ElementType> |
|
inline |
Constructor taking pointers to the two sets that defines the range of the indices of the BivariateSet.
|
pure virtual |
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 virtual |
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 virtual |
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 virtual |
Size of the BivariateSet, which is the number of non-zero entries in the BivariateSet.
Implemented in axom::slam::NullBivariateSet< PosType, ElemType >, axom::slam::NullBivariateSet< SetPosition, SetElement >, and axom::slam::ProductSet< PosType, ElemType >.
Referenced by axom::slam::BivariateSet< RelationType::SetPosition, RelationType::SetElement >::BivariateSet(), axom::slam::BivariateMap< SetType, DataType, StridePolicy >::BivariateMapIterator::numComp(), and axom::slam::BivariateMap< SetType, DataType, StridePolicy >::operator[]().
|
pure virtual |
Number of elements of the BivariateSet whose first index is pos.
Implemented in axom::slam::NullBivariateSet< PosType, ElemType >, and axom::slam::NullBivariateSet< SetPosition, SetElement >.
|
inline |
|
inline |
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().
|
inlinevirtual |
Returns pointer to the first set.
|
inlinevirtual |
Returns pointer to the second set.
|
pure virtual |
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 virtual |
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().
|
inlinevirtual |
Reimplemented in axom::slam::RelationSet< RelationType >, and axom::slam::ProductSet< PosType, ElemType >.
Referenced by axom::slam::ProductSet< PosType, ElemType >::isValid().
|
pure virtual |
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().
|
static |
|
static |
|
protected |
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().
|
protected |
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().