36 #ifndef COLUMNITERATOR_H_ 37 #define COLUMNITERATOR_H_ 47 using pointer =
float const *;
48 using iterator_category = std::random_access_iterator_tag;
49 using reference =
float const &;
50 using value_type =
float const;
51 using difference_type = std::ptrdiff_t;
55 ColumnIterator(
const std::vector<float>::const_iterator &p,
const int stride)
56 : m_p(&(*p)), m_stride(stride) {}
58 reference operator*()
const {
return dereference(); }
60 reference operator->()
const {
return dereference(); }
79 reference operator[](
const int i)
const {
return operator+(i).dereference(); }
82 return (m_p - start.m_p) / m_stride;
85 inline bool operator==(
const ColumnIterator &rhs)
const {
return equal(rhs); }
88 return !operator==(rhs);
92 bool equal(
ColumnIterator const &other)
const {
return m_p == other.m_p; }
94 reference dereference()
const {
return *m_p; }
96 void increment() { std::advance(m_p, m_stride); }
98 void increment(
const int n) { std::advance(m_p, n * m_stride); }
106 #endif // COLUMNITERATOR_H_ A const iterator that iterates through a single column of the raw data class Impliments an random acc...
Definition: ColumnIterator.hpp:45
Definition: Backend.cpp:39