28 #include "../../utilities/container_utils.hpp"
92 return std::accumulate(
_shape.begin(),
_shape.end(),size_t(1),
93 std::multiplies<size_t>());
105 constexpr
size_t rank()
const {
return sizeof...(DIMS); }
138 template<
typename CTYPE,
145 typename std::remove_const<
146 typename std::remove_reference<CTYPE>::type
153 return implementation_type::template
offset(
_shape,index);
165 template<
typename CTYPE,
168 typename std::remove_const<
169 typename std::remove_reference<CTYPE>::type
177 return implementation_type::template
offset(s,
_shape,index);
196 template<
typename CTYPE> CTYPE
index(
size_t offset)
const
203 implementation_type::template
index(
_shape,index,offset);
221 template<
typename MAP_IMP,
size_t... DIMS>
222 constexpr
typename static_index_map<MAP_IMP,DIMS...>::storage_type
223 static_index_map<MAP_IMP,DIMS...>::_shape;
storage_type::const_iterator const_iterator
constant iterator over the map
Definition: static_index_map.hpp:74
static container_type create(size_t n, value_type default_value=value_type())
create container of given size
Definition: container_utils.hpp:85
std::array< size_t, sizeof...(DIMS)> storage_type
storage type
Definition: static_index_map.hpp:68
MAP_IMP implementation_type
policy type
Definition: static_index_map.hpp:70
CTYPE index(size_t offset) const
compute index
Definition: static_index_map.hpp:200
selection from a multidimensional array
Definition: array_selection.hpp:72
storage_type index_type
index type
Definition: static_index_map.hpp:72
Definition: add_op.hpp:29
the static general index map template
Definition: static_index_map.hpp:63
invoke< std::enable_if< C::value >> enable_if
shortcut for std::enable_if
Definition: sfinae_macros.hpp:108
size_t offset(const CTYPE &index) const
compute the offset
Definition: static_index_map.hpp:151
size_t offset(const array_selection &s, const CTYPE &index) const
compute offset with selection
Definition: static_index_map.hpp:174
size_t max_elements() const
get number of elements
Definition: static_index_map.hpp:90
type erasure for POD data
Definition: value.hpp:46
constexpr size_t size() const
get number of elements
Definition: static_index_map.hpp:115
static constexpr storage_type _shape
storage for shape information
Definition: static_index_map.hpp:77
const_iterator begin() const
get a const iterator to the first element
Definition: static_index_map.hpp:211
constexpr size_t rank() const
get number of dimensions
Definition: static_index_map.hpp:105
const_iterator end() const
get a const iterator to the last+1 element
Definition: static_index_map.hpp:217