242 template <
int dim,
typename Number>
245 const unsigned int n_nearest_neighbors)
247 , n_nearest_neighbors(n_nearest_neighbors)
252 template <
int dim,
typename Number>
256 return n_nearest_neighbors;
261 template <
int dim,
typename Number>
265 return points.size();
270 template <
int dim,
typename Number>
271 const ::Point<dim, Number> &
279 template <
int dim,
typename Number>
281 const std::vector<::BoundingBox<dim, Number>> &bb)
287 template <
int dim,
typename Number>
291 return bounding_boxes.size();
296 template <
int dim,
typename Number>
297 const ::BoundingBox<dim, Number> &
300 return bounding_boxes[i];
305 template <
int dim,
typename Number>
307 const std::vector<::BoundingBox<dim, Number>> &bounding_boxes,
308 const unsigned int n_nearest_neighbors)
309 : bounding_boxes(bounding_boxes)
310 , n_nearest_neighbors(n_nearest_neighbors)
315 template <
int dim,
typename Number>
319 return n_nearest_neighbors;
324 template <
int dim,
typename Number>
328 return bounding_boxes.size();
333 template <
int dim,
typename Number>
334 const ::BoundingBox<dim, Number> &
337 return bounding_boxes[i];
341 template <
int dim,
typename Number>
343 const std::vector<std::pair<::Point<dim, Number>, Number>> &spheres)
349 template <
int dim,
typename Number>
353 return spheres.size();
358 template <
int dim,
typename Number>
359 const std::pair<::Point<dim, Number>,
Number> &
367 template <
int dim,
typename Number>
369 const std::vector<std::pair<::Point<dim, Number>, Number>> &spheres,
370 const unsigned int n_nearest_neighbors)
372 , n_nearest_neighbors(n_nearest_neighbors)
377 template <
int dim,
typename Number>
381 return n_nearest_neighbors;
386 template <
int dim,
typename Number>
390 return spheres.size();
395 template <
int dim,
typename Number>
396 const std::pair<::Point<dim, Number>,
Number> &
409#if ARBORX_VERSION_MAJOR < 2
412 template <
int dim,
typename Number>
414 to_arborx_point(::Point<dim, Number> p)
416 static_assert(dim >= 1 && dim <= 3);
418 return {float(p[0]), 0.f, 0.f};
420 return {float(p[0]), float(p[1]), 0.f};
422 return {float(p[0]), float(p[1]), float(p[2])};
429 template <
int dim,
typename Number>
431 AccessTraits<std::vector<::Point<dim, Number>>, PrimitivesTag>
::size(
439 template <
int dim,
typename Number>
441 AccessTraits<std::vector<::Point<dim, Number>>, PrimitivesTag>
::get(
447 return to_arborx_point(v[i]);
453 template <
int dim,
typename Number>
455 AccessTraits<std::vector<::BoundingBox<dim, Number>>, PrimitivesTag>::
463 template <
int dim,
typename Number>
465 AccessTraits<std::vector<::BoundingBox<dim, Number>>, PrimitivesTag>::
468 const auto boundary_points = v[i].get_boundary_points();
469 const ::Point<dim, Number> min_corner = boundary_points.first;
470 const ::Point<dim, Number> max_corner = boundary_points.second;
473 return {to_arborx_point(min_corner), to_arborx_point(max_corner)};
479 template <
int dim,
typename Number>
481 AccessTraits<std::vector<std::pair<::Point<dim, Number>, Number>>,
490 template <
int dim,
typename Number>
492 AccessTraits<std::vector<std::pair<::Point<dim, Number>, Number>>,
499 return {to_arborx_point(v[i].first),
static_cast<float>(v[i].second)};
503 template <
typename T>
508 std::is_same_v<T, ::Point<T::dimension, float>> ||
509 std::is_same_v<T, ::Point<T::dimension, double>> ||
510 std::is_same_v<T, ::BoundingBox<T::dimension, float>> ||
511 std::is_same_v<T, ::BoundingBox<T::dimension, double>> ||
512 std::is_same_v<T, std::pair<::Point<T::dimension, float>,
float>> ||
514 std::pair<::Point<T::dimension, double>,
double>>>>::
515 size(
const std::vector<T> &v)
522 template <
typename T>
527 std::is_same_v<T, ::Point<T::dimension, float>> ||
528 std::is_same_v<T, ::Point<T::dimension, double>> ||
529 std::is_same_v<T, ::BoundingBox<T::dimension, float>> ||
530 std::is_same_v<T, ::BoundingBox<T::dimension, double>> ||
531 std::is_same_v<T, std::pair<::Point<T::dimension, float>,
float>> ||
533 std::pair<::Point<T::dimension, double>,
double>>>>::
534 get(
const std::vector<T> &v, std::size_t i)
542#include "arborx/access_traits.inst"