23 size_t knn_search(
const T& tree,
const Eigen::Vector4d&
point,
size_t k,
size_t* k_indices,
double* k_sq_dists) {
30 template <
typename U,
int = (&Traits<U>::nearest_neighbor_search, 0)>
31 static std::true_type
test(U*);
32 static std::false_type
test(...);
43 template <typename T, std::enable_if_t<has_nearest_neighbor_search<T>::value,
bool> =
true>
54 template <typename T, std::enable_if_t<!has_nearest_neighbor_search<T>::value,
bool> =
true>
size_t nearest_neighbor_search(const T &tree, const Eigen::Vector4d &point, size_t *k_index, double *k_sq_dist)
Find the nearest neighbor. If Traits<T>::nearest_neighbor_search is not defined, fallback to knn_sear...
Definition: traits.hpp:44
auto point(const T &points, size_t i)
Get i-th point. 4D vector is used to take advantage of SIMD intrinsics. The last element must be fill...
Definition: traits.hpp:40
size_t knn_search(const T &tree, const Eigen::Vector4d &point, size_t k, size_t *k_indices, double *k_sq_dists)
Find k-nearest neighbors.
Definition: traits.hpp:23
Definition: flat_container.hpp:12
Definition: traits.hpp:13
Check if T has nearest_neighbor_search method.
Definition: traits.hpp:29
static std::true_type test(U *)
static constexpr bool value
Definition: traits.hpp:34
static std::false_type test(...)