Skip to content

ArborX::nearest

Andrey Prokopenko edited this page Oct 28, 2024 · 3 revisions

ArborX / Predicates

ArborX::nearest

template <typename Geometry>
KOKKOS_FUNCTION unspecified nearest(Geometry const& geometry, std::size_t k = 1) noexcept;

Generate a nearest predicate to perform a $k$-nearest neighbors search with in a spatial index' query().

Template parameter(s)

Geometry : The geometry type, e.g. ArborX::Point, ArborX::Box, or ArborX::Sphere.

Parameter(s)

geometry : The geometry object from which distance is calculated. k : The number of primitives to search for.

Example

auto nearest_five_to_origin_pred = ArborX::nearest(ArborX::Point{0.f, 0.f, 0.f}, 5);
Clone this wiki locally