9 #ifndef tensor_iterator_dim_H_ 10 #define tensor_iterator_dim_H_ 18 template<direction direction,
class Tensor>
24 using value_type = decltype(std::declval<Tensor>().slice(0));
32 tensor(tensor_), index(index_) {}
34 #define BC_ND_Iter_Compare(sign, rev) \ 36 bool operator sign (const Iterator& iter) { \ 37 if (direction == direction::forward) \ 38 return index sign iter.index; \ 40 return index rev iter.index; \ 43 bool operator sign (int p_index) { \ 44 if (direction == direction::forward) \ 45 return index sign p_index; \ 47 return index rev p_index; \ 53 #undef BC_ND_Iter_Compare 58 return index == iter.
index;
61 return index != iter.
index;
89 template<
class Tensor>
94 template<
class Tensor>
99 template<
class Tensor>
104 template<
class Tensor>
Multidimensional_Iterator< direction, Tensor > Iterator
Definition: multidimensional_iterator.h:22
value_type reference
Definition: multidimensional_iterator.h:26
#define BCINLINE
Definition: common.h:96
BCINLINE Iterator & operator-=(int dist)
Definition: multidimensional_iterator.h:73
BCINLINE Iterator & operator+=(int dist)
Definition: multidimensional_iterator.h:72
value_type operator*()
Definition: multidimensional_iterator.h:84
BCINLINE Iterator & operator++()
Definition: multidimensional_iterator.h:66
int difference_type
Definition: multidimensional_iterator.h:25
BCINLINE Iterator operator-(int dist) const
Definition: multidimensional_iterator.h:76
const value_type operator*() const
Definition: multidimensional_iterator.h:83
auto iter_rbegin(Tensor &derived)
Definition: multidimensional_iterator.h:100
BCINLINE Iterator & operator--()
Definition: multidimensional_iterator.h:67
BCINLINE Iterator operator+(int dist) const
Definition: multidimensional_iterator.h:75
Tensor & tensor
Definition: multidimensional_iterator.h:28
bc::size_t index
Definition: multidimensional_iterator.h:29
int size_t
Definition: common.h:283
auto iter_end(Tensor &derived)
Definition: multidimensional_iterator.h:95
auto iter_rend(Tensor &derived)
Definition: multidimensional_iterator.h:105
Definition: multidimensional_iterator.h:19
direction
Definition: common.h:18
auto iter_begin(Tensor &derived)
Definition: multidimensional_iterator.h:90
#define BC_ND_Iter_Compare(sign, rev)
Definition: multidimensional_iterator.h:34
BCINLINE bool operator==(const Iterator &iter)
Definition: multidimensional_iterator.h:57
BCINLINE Iterator & operator=(int index_)
Definition: multidimensional_iterator.h:64
std::random_access_iterator_tag iterator_category
Definition: multidimensional_iterator.h:23
BCINLINE Multidimensional_Iterator(Tensor &tensor_, bc::size_t index_=0)
Definition: multidimensional_iterator.h:31
BCINLINE bool operator!=(const Iterator &iter)
Definition: multidimensional_iterator.h:60
decltype(std::declval< Tensor >().slice(0)) value_type
Definition: multidimensional_iterator.h:24
The Evaluator determines if an expression needs to be greedily optimized.
Definition: algorithms.h:22