1#ifndef TENSOR_ITERATOR_H
2#define TENSOR_ITERATOR_H
19 TensorIterator(T *elements, std::ptrdiff_t step = 1) : _elements(elements), _step(step) {}
47 _elements += val * _step;
52 _elements -= val * _step;
72 return (_elements - other._elements) / _step;
76 return _elements == other._elements;
79 return _elements != other._elements;
84 return _elements <= other._elements;
87 return _elements >= other._elements;
reference operator*() const
friend TensorIterator operator+(const difference_type &val, TensorIterator iterator)
TensorIterator & operator++()
bool operator<(const TensorIterator &other) const
TensorIterator(T *elements, std::ptrdiff_t step=1)
TensorIterator operator--(int)
difference_type operator-(const TensorIterator &other) const
bool operator<=(const TensorIterator &other) const
TensorIterator & operator--()
pointer operator->() const
TensorIterator & operator-=(const difference_type &val)
TensorIterator & operator+=(const difference_type &val)
bool operator!=(const TensorIterator &other) const
bool operator>=(const TensorIterator &other) const
bool operator>(const TensorIterator &other) const
std::random_access_iterator_tag iterator_category
TensorIterator operator++(int)
friend TensorIterator operator+(TensorIterator iterator, const difference_type &val)
std::ptrdiff_t difference_type
bool operator==(const TensorIterator &other) const
friend TensorIterator operator-(TensorIterator iterator, const difference_type &val)