AXOM
Axom provides a robust, flexible software infrastructure for the development of multi-physics applications and computational tools.
|
A Map class that associates a constant number of values to every element in a set. More...
#include </home/docs/checkouts/readthedocs.org/user_builds/axom/checkouts/v0.3.3/src/axom/slam/Map.hpp>
Classes | |
class | MapBuilder |
Helper class for constructing a Map. More... | |
class | MapIterator |
An iterator type for a map. Each increment operation advances the iterator to the next set element. To access the jth component values of the iterator's current element, use iter(j) . More... | |
Public Types | |
using | OrderedMap = std::vector< DataType > |
using | StridePolicyType = StridePolicy |
using | SetPosition = typename SetType::PositionType |
using | SetElement = typename SetType::ElementType |
using | const_iterator = MapIterator |
using | const_iterator_pair = std::pair< const_iterator, const_iterator > |
using | iterator = const_iterator |
using | iterator_pair = const_iterator_pair |
Public Member Functions | |
Map (const SetType *theSet=&s_nullSet, DataType defaultValue=DataType(), SetPosition stride=StridePolicyType::DEFAULT_VALUE) | |
Constructor for Map using a Set pointer. More... | |
Map (const Map &otherMap) | |
Map (const MapBuilder &builder) | |
Constructor for Map using a MapBuilder. More... | |
Map & | operator= (const Map &otherMap) |
Assignment operator for Map. More... | |
const SetType * | set () const |
Returns a pointer to the map's underlying set. More... | |
void | print () const |
print information on the map, including every element inside Map More... | |
bool | isValid (bool verboseOutput=false) const |
returns true if the map is valid, false otherwise. More... | |
MapIterator | begin () |
MapIterator | end () |
const_iterator_pair | range () const |
OrderedMap & | data () |
Returns a reference to the underlying map data. More... | |
const OrderedMap & | data () const |
Map individual access functions | |
const DataType & | operator[] (SetPosition setIndex) const |
Access the value in the map using a flat index in the range of 0 to size()*numComp() More... | |
DataType & | operator[] (SetPosition setIndex) |
const DataType & | operator() (SetPosition setIdx, SetPosition comp=0) const |
Access the value associated with the given position in the set and the component index. More... | |
DataType & | operator() (SetPosition setIdx, SetPosition comp=0) |
Map cardinality functions | |
SetPosition | size () const |
Return the set size. Same as set()->size() . More... | |
SetPosition | numComp () const |
Map modifying functions for all entries | |
void | clear () |
replace all elements in the Map with the default DataType More... | |
void | fill (DataType val=DataType()) |
void | copy (const Map &other) |
Element-wise copy of data from another map. More... | |
Static Public Attributes | |
static const NullSet< SetPosition, SetElement > | s_nullSet |
Definition of static instance of nullSet for all maps. More... | |
A Map class that associates a constant number of values to every element in a set.
DataType | The data type of each value |
StridePolicy | A policy class that determines how many values to associate with each element. There is a fixed stride between the data associated with each element of the set. |
The map class associates a fixed number of values, also referred to as components, with each element in its underlying Set instance. Depending on the StridePolicy, this can be fixed at compile time or at runtime.
Access to the jth component of the ith element, can be obtained via the parenthesis operator ( map(i,j)
), or via the square bracket operator (i.e. map[k]
, where k = i * stride() + j
).
using axom::slam::Map< SetType, DataType, StridePolicy >::OrderedMap = std::vector<DataType> |
using axom::slam::Map< SetType, DataType, StridePolicy >::StridePolicyType = StridePolicy |
using axom::slam::Map< SetType, DataType, StridePolicy >::SetPosition = typename SetType::PositionType |
using axom::slam::Map< SetType, DataType, StridePolicy >::SetElement = typename SetType::ElementType |
using axom::slam::Map< SetType, DataType, StridePolicy >::const_iterator = MapIterator |
using axom::slam::Map< SetType, DataType, StridePolicy >::const_iterator_pair = std::pair<const_iterator, const_iterator> |
using axom::slam::Map< SetType, DataType, StridePolicy >::iterator = const_iterator |
using axom::slam::Map< SetType, DataType, StridePolicy >::iterator_pair = const_iterator_pair |
|
inline |
Constructor for Map using a Set pointer.
theSet | (Optional) A pointer to the map's set |
defaultValue | (Optional) If given, every entry in the map will be initialized using defaultValue |
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. |
|
inline |
Copy constructor from another map
|
inline |
Constructor for Map using a MapBuilder.
|
inline |
Assignment operator for Map.
|
inline |
Returns a pointer to the map's underlying set.
Referenced by axom::spin::ImplicitGrid< NDIMS, TheIndexType >::insert().
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinevirtual |
Return the set size. Same as set()->size()
.
The total storage size for the map's values is size() * numComp()
Implements axom::slam::MapBase.
Referenced by axom::slam::Map< slam::Set< CoordType, CoordType >, OctreeLevelType * >::copy(), axom::slam::Map< slam::Set< CoordType, CoordType >, OctreeLevelType * >::data(), axom::slam::Map< slam::Set< CoordType, CoordType >, OctreeLevelType * >::end(), and axom::slam::Map< slam::Set< CoordType, CoordType >, OctreeLevelType * >::print().
|
inline |
|
inline |
replace all elements in the Map with the default DataType
|
inline |
Set each entry in the map to the given value
Referenced by axom::slam::Map< slam::Set< CoordType, CoordType >, OctreeLevelType * >::clear().
|
inline |
Element-wise copy of data from another map.
Referenced by axom::slam::Map< slam::Set< CoordType, CoordType >, OctreeLevelType * >::Map().
void axom::slam::Map< SetType, DataType, StridePolicy >::print | ( | ) | const |
print information on the map, including every element inside Map
Referenced by axom::slam::Map< slam::Set< CoordType, CoordType >, OctreeLevelType * >::copy().
|
virtual |
returns true if the map is valid, false otherwise.
Implements axom::slam::MapBase.
Referenced by axom::slam::Map< slam::Set< CoordType, CoordType >, OctreeLevelType * >::copy(), and axom::slam::Map< slam::Set< CoordType, CoordType >, OctreeLevelType * >::print().
|
inline |
|
inline |
|
inline |
|
inline |
Returns a reference to the underlying map data.
|
inline |
|
static |
Definition of static instance of nullSet for all maps.
Referenced by axom::slam::Map< SetType, DataType, StridePolicy >::MapBuilder::data().