|
using | DataType = T |
|
using | BivariateSetType = BSet |
|
using | IndirectionPolicy = IndPol |
|
using | StridePolicyType = StrPol |
|
using | SetPosition = typename BSet::PositionType |
|
using | SetElement = typename BSet::ElementType |
|
using | SetType = typename slam::RangeSet< SetPosition, SetElement >::ConcreteSet |
|
using | MapType = Map< DataType, SetType, IndPol, StrPol, IfacePol > |
|
using | OrderedSetType = typename BSet::SubsetType |
|
using | ValueType = typename IndirectionPolicy::IndirectionResult |
|
using | ConstValueType = typename IndirectionPolicy::ConstIndirectionResult |
|
using | PointerType = std::remove_reference_t< ValueType > * |
|
using | ConstPointerType = std::remove_reference_t< ConstValueType > * |
|
using | BivariateMapType = BivariateMap< DataType, BSet, IndPol, StrPol, IfacePol > |
|
using | iterator = BivariateMapIterator< false > |
|
using | const_iterator = BivariateMapIterator< true > |
|
using | SubMapType = SubMap< BivariateMapType, SetType, IfacePol > |
|
using | ConstSubMapType = const SubMap< const BivariateMapType, SetType, IfacePol > |
|
using | SubMapIterator = typename SubMapType::iterator |
|
using | ConstSubMapIterator = typename ConstSubMapType::iterator |
|
using | NullBivariateSetType = NullBivariateSet< typename BSet::FirstSetType, typename BSet::SecondSetType > |
|
using | ConcreteMap = BivariateMap< T, BSet, IndPol, StrPol, policies::ConcreteInterface > |
|
using | VirtualMap = BivariateMap< T, BSet, IndPol, StrPol, policies::VirtualInterface > |
|
|
| BivariateMap (const BivariateSetType *bSet=&s_nullBiSet, DataType defaultValue=DataType(), SetPosition stride=StridePolicyType::DEFAULT_VALUE, int allocatorID=axom::getDefaultAllocatorID()) |
| Constructor for a BivariateMap. More...
|
|
template<typename UBSet , typename Enable = typename std::enable_if< !std::is_abstract<BivariateSetType>::value && std::is_base_of<BivariateSetType, UBSet>::value>::type> |
| BivariateMap (const UBSet &bSet, DataType defaultValue=DataType(), SetPosition stride=StridePolicyType::DEFAULT_VALUE, int allocatorID=axom::getDefaultAllocatorID()) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
|
|
| BivariateMap (const BivariateSetType *bSet, typename MapType::OrderedMap data, SetPosition stride=StridePolicyType::DEFAULT_VALUE) |
| Constructor for BivariateMap using a BivariateSet passed by-value and data passed in by-value. More...
|
|
template<typename UBSet , typename TBSet = BivariateSetType, typename Enable = typename std::enable_if<!std::is_abstract<TBSet>::value && std::is_base_of<TBSet, UBSet>::value>::type> |
| BivariateMap (const UBSet &bSet, typename MapType::OrderedMap data, SetPosition stride=StridePolicyType::DEFAULT_VALUE) |
| Constructor for BivariateMap using a BivariateSet passed by-value and data passed in by-value. More...
|
|
template<typename BivariateSetRetType , typename RelType = void> |
std::enable_if<!traits::has_relation_ptr< BivariateSetRetType >::value, BivariateSetRetType >::type | getBivariateSet () const |
|
template<typename BivariateSetRetType , typename RelType > |
std::enable_if< traits::has_relation_ptr< BivariateSetRetType >::value, BivariateSetRetType >::type | getBivariateSet () const |
|
AXOM_HOST_DEVICE iterator | begin () |
|
AXOM_HOST_DEVICE iterator | end () |
|
AXOM_HOST_DEVICE const_iterator | begin () const |
|
AXOM_HOST_DEVICE const_iterator | end () const |
|
AXOM_HOST_DEVICE SubMapIterator | begin (int i) |
|
AXOM_HOST_DEVICE SubMapIterator | end (int i) |
|
AXOM_HOST_DEVICE ConstSubMapIterator | begin (int i) const |
|
AXOM_HOST_DEVICE ConstSubMapIterator | end (int i) const |
|
AXOM_HOST_DEVICE const BivariateSetType * | set () const |
|
const MapType * | getMap () const |
|
MapType * | getMap () |
|
bool | isValid (bool verboseOutput=false) const |
|
void | copy (const DataType *data_arr) |
| Given a DataType array of size totalSize()*numComp() , copy the data into the BivariateMap storage. More...
|
|
void | clear () |
| replace all elements in the Map with the default DataType More...
|
|
AXOM_HOST_DEVICE const typename BSet::PositionType | stride () const |
|
const typename BSet::PositionType | operator() () const |
|
AXOM_HOST_DEVICE void | setStride (typename BSet::PositionType AXOM_DEBUG_PARAM(val)) |
|
|
AXOM_HOST_DEVICE ConstValueType | operator[] (SetPosition setIndex) const |
| Access the value in the map using a FlatIndex in the range of 0 to size()*numComp() More...
|
|
AXOM_HOST_DEVICE ValueType | operator[] (SetPosition setIndex) |
|
AXOM_HOST_DEVICE ConstSubMapType | operator() (SetPosition firstIdx) const |
| Returns a SubMap containing the subset of the BivariateMap given the first set index. More...
|
|
AXOM_HOST_DEVICE SubMapType | operator() (SetPosition firstIdx) |
|
AXOM_HOST_DEVICE ConstValueType | operator() (SetPosition s1, SetPosition s2, SetPosition comp=0) const |
| Access the value associated with the given SparseIndex into the BivariateSet and the component index. More...
|
|
AXOM_HOST_DEVICE ValueType | operator() (SetPosition s1, SetPosition s2, SetPosition comp=0) |
|
AXOM_HOST_DEVICE ConstPointerType | findValue (SetPosition s1, SetPosition s2, SetPosition comp=0) const |
| Access the value associated with the given DenseIndex into the BivariateSet and the component index. More...
|
|
AXOM_HOST_DEVICE PointerType | findValue (SetPosition s1, SetPosition s2, SetPosition comp=0) |
|
|
SetPosition | index (SetPosition s1, SetPosition s2) const |
| Returns the SparseIndex of the element given the DenseIndex. More...
|
|
OrderedSetType | indexSet (SetPosition s1) const |
| Return a set of DenseIndex associated to the given first set index. More...
|
|
AXOM_HOST_DEVICE SetPosition | flatIndex (SetPosition s1, SetPosition s2) const |
| Search for the FlatIndex of an element given its DenseIndex in the BivariateSet. More...
|
|
|
AXOM_HOST_DEVICE SetPosition | size () const |
| Returns the BivariateSet size. More...
|
|
SetPosition | totalSize () const |
| Returns the BivariateSet size. More...
|
|
SetPosition | firstSetSize () const |
|
AXOM_HOST_DEVICE SetPosition | secondSetSize () const |
|
SetPosition | size (SetPosition s) const |
| Returns the number of the BivariateSet ordered pairs with the given first set index. More...
|
|
SetPosition | numComp () const |
| Return the number of components of the map
More...
|
|
template<typename T, typename BSet = BivariateSet<>, typename IndPol = policies::STLVectorIndirection<typename BSet::PositionType, T>, typename StrPol = policies::StrideOne<typename BSet::PositionType>, typename IfacePol = policies::VirtualInterface>
class axom::slam::BivariateMap< T, BSet, IndPol, StrPol, IfacePol >
A Map for BivariateSet. It associates a constant number of values to every element in a BivariateSet (as determined by StridePolicy).
\detail Like BivariateSet, every value in BivariateMap is indexed by two indices. BivariateMap's operator(i)
returns a SubMap of all entries whose first index is i
in the BivariateSet.
The different indexing systems (DenseIndex, SparseIndex, FlatIndex) are explained in BivariateSet. Because BivariateMap can have more than one component, FlatIndex is further divided into ComponentFlatIndex, where each component in each element is indexed separately, and ElementFlatIndex, an index that disregards the individual components. Hence, to access each component, one would need to provide a component index as well.
Example: For a 2 x 2 sparse matrix with 3 components below:
Access the elements using ElementFlatIndex (e)
would be...
(e = 0) = abc
(e = 1) = def
To access each component, provide a component index (c) (e = 0, c = 0) = a
(e = 0, c = 1) = b
(e = 0, c = 2) = c
(e = 1, c = 0) = d
(e = 1, c = 1) = e
(e = 1, c = 2) = f
To access using ComponentFlatIndex (idx)
...
(idx = 0) = a
(idx = 1) = b
(idx = 2) = c
(idx = 3) = d
(idx = 4) = e
(idx = 5) = f
- Template Parameters
-
DataType | the data type of each value |
StridePolicy | A policy class for configuring the number of components associate with each element. There is a fixed stride between the data associated with each element of the set. |
- See also
- BivariateSet, SubMap
template<typename T , typename BSet = BivariateSet<>, typename IndPol = policies::STLVectorIndirection<typename BSet::PositionType, T>, typename StrPol = policies::StrideOne<typename BSet::PositionType>, typename IfacePol = policies::VirtualInterface>
template<typename UBSet , typename Enable = typename std::enable_if< !std::is_abstract<BivariateSetType>::value && std::is_base_of<BivariateSetType, UBSet>::value>::type>
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
template<typename T , typename BSet = BivariateSet<>, typename IndPol = policies::STLVectorIndirection<typename BSet::PositionType, T>, typename StrPol = policies::StrideOne<typename BSet::PositionType>, typename IfacePol = policies::VirtualInterface>
template<typename UBSet , typename TBSet = BivariateSetType, typename Enable = typename std::enable_if<!std::is_abstract<TBSet>::value && std::is_base_of<TBSet, UBSet>::value>::type>
Constructor for BivariateMap using a BivariateSet passed by-value and data passed in by-value.
- Parameters
-
bSet | A reference to the map's associated bivariate set |
data | The data buffer to set the map's data to. |
stride | (Optional) The stride. The number of DataType that each element in the set will be mapped to. When using a RuntimeStridePolicy, the default is 1. |
- Note
- When using a compile time StridePolicy, stride must be equal to stride(), when provided.
template<typename T , typename BSet = BivariateSet<>, typename IndPol = policies::STLVectorIndirection<typename BSet::PositionType, T>, typename StrPol = policies::StrideOne<typename BSet::PositionType>, typename IfacePol = policies::VirtualInterface>