28 #include "index_map/index_maps.hpp"
98 template<
typename CTYPE>
100 _index_map(
map_utils<map_type>::create(shape)),
117 template<
typename CTYPE>
118 static iterator_type
begin(
const CTYPE &shape)
133 template<
typename CTYPE>
134 static iterator_type
end(
const CTYPE &shape)
136 size_t size=std::accumulate(shape.begin(),shape.end(),size_t(1),
137 std::multiplies<size_t>());;
166 if(_state < ssize_t(_index_map.max_elements()))
167 _index = _index_map.template index<index_type>(
_state);
175 iterator_type temp = *
this;
186 _index = _index_map.template index<index_type>(
_state);
195 iterator_type temp = *
this;
204 return this->_state==a.
_state;
211 if(*
this == a)
return false;
index iterator
Definition: index_iterator.hpp:55
const value_type * pointer
pointer type to an index
Definition: index_iterator.hpp:66
index_type value_type
type to store the index
Definition: index_iterator.hpp:64
index_iterator< index_type, map_type > iterator_type
type of the iterator
Definition: index_iterator.hpp:74
iterator_type operator++(int)
postfix increment operator
Definition: index_iterator.hpp:173
const value_type & reference
reference type to an index
Definition: index_iterator.hpp:68
index_type _index
index buffer
Definition: index_iterator.hpp:81
index_iterator(const CTYPE &shape, size_t state=0)
constructor
Definition: index_iterator.hpp:99
utility class for index maps
Definition: index_maps.hpp:100
map_type _index_map
the index map used to compute the indices
Definition: index_iterator.hpp:77
Definition: add_op.hpp:29
ssize_t _state
the actual state of the iterator
Definition: index_iterator.hpp:79
static iterator_type end(const CTYPE &shape)
static creation function
Definition: index_iterator.hpp:134
value_type operator*()
dereferencing operator
Definition: index_iterator.hpp:149
INDEXT index_type
local index type
Definition: index_iterator.hpp:62
bool operator==(const iterator_type &a)
equality operator
Definition: index_iterator.hpp:202
const value_type * cptr_type
container pointer type
Definition: index_iterator.hpp:70
iterator_type operator--(int)
postfix decrement operator
Definition: index_iterator.hpp:193
IMT map_type
local index map type
Definition: index_iterator.hpp:60
ssize_t difference_type
iterator difference type
Definition: index_iterator.hpp:72
bool operator!=(const iterator_type &a)
inequality operator
Definition: index_iterator.hpp:209
iterator_type & operator++()
increment operator
Definition: index_iterator.hpp:163
size_t size(const slice &s)
compute slice size
index_iterator()
default constructor
pointer operator->()
pointer access operator
Definition: index_iterator.hpp:156
iterator_type & operator--()
decrement operator
Definition: index_iterator.hpp:182
static iterator_type begin(const CTYPE &shape)
static creation function
Definition: index_iterator.hpp:118