9 #ifndef ELEMENTWISE_Coefficientwise_Iterator_H_ 10 #define ELEMENTWISE_Coefficientwise_Iterator_H_ 18 template<direction Direction,
class Tensor,
class enabler=
void>
33 tensor(tensor), index(index) {}
36 this->index = iter.
index;
40 #define BC_Iter_Compare(sign, rev) \ 42 bool operator sign (const Iterator& iter) { \ 43 if (Direction == direction::forward) \ 44 return index sign iter.index; \ 46 return index rev iter.index; \ 49 bool operator sign (int p_index) { \ 50 if (Direction == direction::forward) \ 51 return index sign p_index; \ 53 return index rev p_index; \ 61 #undef BC_Iter_Compare 66 return index == iter.
index;
69 return index != iter.
index;
102 template<
class Tensor>
107 template<
class Tensor>
112 template<
class Tensor>
117 template<
class Tensor>
#define BCINLINE
Definition: common.h:96
BCINLINE bool operator==(const Iterator &iter)
Definition: coefficientwise_iterator.h:65
BCINLINE Coefficientwise_Iterator & operator=(const Coefficientwise_Iterator &iter)
Definition: coefficientwise_iterator.h:35
Definition: coefficientwise_iterator.h:19
BCINLINE auto operator*() -> decltype(this->tensor[this->index])
Definition: coefficientwise_iterator.h:96
BCINLINE Iterator & operator+=(int dist)
Definition: coefficientwise_iterator.h:81
value_type & reference
Definition: coefficientwise_iterator.h:25
BCINLINE Iterator operator-(int dist) const
Definition: coefficientwise_iterator.h:85
BCINLINE Iterator & operator++()
Definition: coefficientwise_iterator.h:74
BCINLINE Coefficientwise_Iterator(Tensor tensor, bc::size_t index=0)
Definition: coefficientwise_iterator.h:32
typename Tensor::value_type value_type
Definition: coefficientwise_iterator.h:23
typename parent_type::value_type value_type
Definition: tensor_base.h:41
auto iter_cw_begin(Tensor &tensor)
Definition: coefficientwise_iterator.h:103
value_type * pointer
Definition: coefficientwise_iterator.h:26
auto iter_cw_end(Tensor &tensor)
Definition: coefficientwise_iterator.h:108
#define BC_Iter_Compare(sign, rev)
Definition: coefficientwise_iterator.h:40
int size_t
Definition: common.h:283
bc::size_t difference_type
Definition: coefficientwise_iterator.h:24
auto iter_cw_rend(Tensor &tensor)
Definition: coefficientwise_iterator.h:118
auto iter_cw_rbegin(Tensor &tensor)
Definition: coefficientwise_iterator.h:113
BCINLINE Iterator & operator-=(int dist)
Definition: coefficientwise_iterator.h:82
bc::size_t index
Definition: coefficientwise_iterator.h:30
BCINLINE auto operator[](int i) const -> decltype(this->tensor[i])
Definition: coefficientwise_iterator.h:98
Coefficientwise_Iterator< Direction, Tensor > Iterator
Definition: coefficientwise_iterator.h:21
BCINLINE Iterator operator+(int dist) const
Definition: coefficientwise_iterator.h:84
BCINLINE auto operator*() const -> decltype(this->tensor[this->index])
Definition: coefficientwise_iterator.h:95
std::random_access_iterator_tag iterator_category
Definition: coefficientwise_iterator.h:22
Tensor tensor
Definition: coefficientwise_iterator.h:29
BCINLINE bool operator!=(const Iterator &iter)
Definition: coefficientwise_iterator.h:68
BCINLINE Iterator & operator--()
Definition: coefficientwise_iterator.h:75
The Evaluator determines if an expression needs to be greedily optimized.
Definition: algorithms.h:22