11 template <
typename NeighborGraph>
28 template <
typename _NeighborGraph>
29 class NeighborGraphRangeIterator
32 using NeighborGraph = _NeighborGraph;
35 using Index =
typename Traits::IndexType;
40 using iterator_category = std::input_iterator_tag;
41 using difference_type = std::ptrdiff_t;
42 using value_type = Index;
43 using pointer = Index*;
44 using reference =
const Index&;
47 Index index = Index(-1))
48 : m_query(query), m_index(index)
54 PONCA_MULTIARCH
bool operator!=(
const NeighborGraphRangeIterator& other)
const
56 return m_index != other.m_index;
60 PONCA_MULTIARCH
bool operator==(
const NeighborGraphRangeIterator& other)
const
62 return m_index == other.m_index;
66 PONCA_MULTIARCH
inline NeighborGraphRangeIterator&
operator++()
68 m_query->advance(*
this);
73 PONCA_MULTIARCH
inline void operator++(value_type) { ++*
this; }
76 PONCA_MULTIARCH
inline reference
operator*()
const {
return const_cast<reference
>(m_index); }
80 value_type m_index{-1};
NeighborGraphDefaultTraits< DataPoint > Traits
NeighborGraphRangeIterator & operator++()
Prefix increment.
bool operator==(const NeighborGraphRangeIterator &other) const
Equality operand.
void operator++(value_type)
Postfix increment.
bool operator!=(const NeighborGraphRangeIterator &other) const
Inequality operand.
reference operator*() const
Dereference operator.
Extension of the Query class that allows to read the result of a range neighbor search on the KnnGrap...
This Source Code Form is subject to the terms of the Mozilla Public License, v.