20template <
class T,
typename Func>
21std::vector<T> findNeighboursInThreshold(
const T& candidate,
22 const std::vector<T>& neighbors,
23 double threshold, Func distanceFunc)
25 std::vector<T> subset;
26 for (
const T& neighbor : neighbors)
28 if (distanceFunc(candidate, neighbor) <= threshold)
30 subset.push_back(neighbor);