9#include "../../query.h"
10#include "../Iterator/neighborGraphOneConnectedIterator.h"
28 template <
typename _NeighborGraph>
29 class NeighborGraphOneConnectedQuery
30 :
public Query<QueryInputIsIndex<typename _NeighborGraph::Traits::IndexType>, NeighborGraphQueryOutputType>
33 using NeighborGraph = _NeighborGraph;
39 using Self = NeighborGraphOneConnectedQuery<NeighborGraph>;
42 PONCA_MULTIARCH
inline NeighborGraphOneConnectedQuery(
const NeighborGraph* graph,
int index)
43 : QueryType(index), m_graph(graph)
47 PONCA_MULTIARCH
inline Self&
operator()(
int index) {
return QueryType::template operator()<Self>(index); }
50 PONCA_MULTIARCH [[nodiscard]]
inline Iterator
begin()
const
52 return Iterator(m_graph->getIndexPtr()) + m_graph->beginId(
QueryType::input());
56 PONCA_MULTIARCH [[nodiscard]]
inline Iterator
end()
const
58 return Iterator(m_graph->getIndexPtr()) + m_graph->endId(
QueryType::input());
NeighborGraphDefaultTraits< DataPoint > Traits
Base iterator class for NeighborGraphOneConnectedQuery.
Iterator end() const
Returns an iterator to the end of the k-nearest neighbors query.
Self & operator()(int index)
Call the k-nearest neighbors query with new input parameter.
Iterator begin() const
Returns an iterator to the beginning of the k-nearest neighbors query.
const InputType & input() const
Query(const typename QueryInType::InputType &in)
Base class for queries output types.
This Source Code Form is subject to the terms of the Mozilla Public License, v.
NeighborGraphBase< NeighborGraphDefaultTraits< DataPoint > > NeighborGraph
Public interface for the NeighborGraph datastructure.
Output type of the NeighborGraphOneConnectedQuery.