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...
|
| BivariateSet (const Set1 *set1=policies::EmptySetTraits< Set1 >::emptySet(), const Set2 *set2=policies::EmptySetTraits< Set2 >::emptySet()) |
| Constructor taking pointers to the two sets that defines the range of the indices of the BivariateSet. More...
|
|
virtual | ~BivariateSet ()=default |
| Default virtual destructor. More...
|
|
virtual PositionType | findElementIndex (PositionType pos1, PositionType pos2) const =0 |
| 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...
|
|
virtual AXOM_HOST_DEVICE 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 AXOM_HOST_DEVICE PositionType | flatToFirstIndex (PositionType flatIndex) const =0 |
| Given the flat index, return the associated from-set index in the relation pair. More...
|
|
virtual AXOM_HOST_DEVICE PositionType | flatToSecondIndex (PositionType flatIndex) const =0 |
| Given the flat index, return the associated to-set index in the relation pair. More...
|
|
virtual AXOM_HOST_DEVICE 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 AXOM_HOST_DEVICE 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...
|
|
AXOM_HOST_DEVICE PositionType | firstSetSize () const |
| Size of the first set.
More...
|
|
AXOM_HOST_DEVICE 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 SubsetType | getElements (PositionType s1) const =0 |
| A set of elements with the given first set index. More...
|
|
virtual bool | isValid (bool verboseOutput=false) const |
|
template<typename Set1 = slam::Set<>, typename Set2 = slam::Set<>>
class axom::slam::BivariateSet< Set1, 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.
\detail 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:
0 1 2 3
_ _ _ _
0 | a b
1 | c d
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