18 #ifdef DEAL_II_WITH_NANOFLANN
28 : max_leaf_size(max_leaf_size)
37 std::vector<std::pair<unsigned int, double>>
47 nanoflann::SearchParams params;
48 params.sorted = sorted;
50 std::vector<std::pair<unsigned int, double>> matches;
51 # if NANOFLANN_VERSION < 0x130
56 kdtree->radiusSearch(
center.
begin_raw(), radius * radius, matches, params);
57 for (std::pair<unsigned int, double> &match : matches)
58 match.second = std::sqrt(match.second);
67 std::vector<std::pair<unsigned int, double>>
69 const unsigned int n_points)
const
75 std::vector<unsigned int> indices(n_points);
76 std::vector<double> distances(n_points);
84 std::vector<std::pair<unsigned int, double>> matches(n_points);
85 for (
unsigned int i = 0; i < n_points; ++i)
86 #
if NANOFLANN_VERSION < 0x130
87 matches[i] = std::make_pair(indices[i], distances[i]);
91 matches[i] = std::make_pair(indices[i], std::sqrt(distances[i]));
104 adaptor = std_cxx14::make_unique<PointCloudAdaptor>(pts);
105 kdtree = std_cxx14::make_unique<NanoFlannKDTree>(
106 dim, *adaptor, nanoflann::KDTreeSingleIndexAdaptorParams(max_leaf_size));
107 kdtree->buildIndex();