244 template <
int dim,
typename Number>
247 const unsigned int n_nearest_neighbors)
249 , n_nearest_neighbors(n_nearest_neighbors)
254 template <
int dim,
typename Number>
258 return n_nearest_neighbors;
263 template <
int dim,
typename Number>
267 return points.size();
272 template <
int dim,
typename Number>
273 const ::Point<dim, Number> &
281 template <
int dim,
typename Number>
283 const std::vector<::BoundingBox<dim, Number>> &bb)
289 template <
int dim,
typename Number>
293 return bounding_boxes.size();
298 template <
int dim,
typename Number>
299 const ::BoundingBox<dim, Number> &
302 return bounding_boxes[i];
307 template <
int dim,
typename Number>
309 const std::vector<::BoundingBox<dim, Number>> &bounding_boxes,
310 const unsigned int n_nearest_neighbors)
311 : bounding_boxes(bounding_boxes)
312 , n_nearest_neighbors(n_nearest_neighbors)
317 template <
int dim,
typename Number>
321 return n_nearest_neighbors;
326 template <
int dim,
typename Number>
330 return bounding_boxes.size();
335 template <
int dim,
typename Number>
336 const ::BoundingBox<dim, Number> &
339 return bounding_boxes[i];
343 template <
int dim,
typename Number>
345 const std::vector<std::pair<::Point<dim, Number>, Number>> &spheres)
351 template <
int dim,
typename Number>
355 return spheres.size();
360 template <
int dim,
typename Number>
361 const std::pair<::Point<dim, Number>, Number> &
369 template <
int dim,
typename Number>
371 const std::vector<std::pair<::Point<dim, Number>, Number>> &spheres,
372 const unsigned int n_nearest_neighbors)
374 , n_nearest_neighbors(n_nearest_neighbors)
379 template <
int dim,
typename Number>
383 return n_nearest_neighbors;
388 template <
int dim,
typename Number>
392 return spheres.size();
397 template <
int dim,
typename Number>
398 const std::pair<::Point<dim, Number>, Number> &
411# if ARBORX_VERSION_MAJOR < 2
414 template <
int dim,
typename Number>
416 to_arborx_point(::Point<dim, Number> p)
418 static_assert(dim >= 1 && dim <= 3);
420 return {float(p[0]), 0.f, 0.f};
422 return {float(p[0]), float(p[1]), 0.f};
424 return {float(p[0]), float(p[1]), float(p[2])};
431 template <
int dim,
typename Number>
433 AccessTraits<std::vector<::Point<dim, Number>>, PrimitivesTag>
::size(
441 template <
int dim,
typename Number>
443 AccessTraits<std::vector<::Point<dim, Number>>, PrimitivesTag>
::get(
449 return to_arborx_point(v[i]);
455 template <
int dim,
typename Number>
457 AccessTraits<std::vector<::BoundingBox<dim, Number>>, PrimitivesTag>::
465 template <
int dim,
typename Number>
467 AccessTraits<std::vector<::BoundingBox<dim, Number>>, PrimitivesTag>::
470 const auto boundary_points = v[i].get_boundary_points();
471 const ::Point<dim, Number> min_corner = boundary_points.first;
472 const ::Point<dim, Number> max_corner = boundary_points.second;
475 return {to_arborx_point(min_corner), to_arborx_point(max_corner)};
481 template <
int dim,
typename Number>
483 AccessTraits<std::vector<std::pair<::Point<dim, Number>, Number>>,
492 template <
int dim,
typename Number>
494 AccessTraits<std::vector<std::pair<::Point<dim, Number>, Number>>,
501 return {to_arborx_point(v[i].first),
static_cast<float>(v[i].second)};
505 template <
typename T>
510 std::is_same_v<T, ::Point<T::dimension, float>> ||
511 std::is_same_v<T, ::Point<T::dimension, double>> ||
512 std::is_same_v<T, ::BoundingBox<T::dimension, float>> ||
513 std::is_same_v<T, ::BoundingBox<T::dimension, double>> ||
514 std::is_same_v<T, std::pair<::Point<T::dimension, float>,
float>> ||
516 std::pair<::Point<T::dimension, double>,
double>>>>::
517 size(
const std::vector<T> &v)
524 template <
typename T>
529 std::is_same_v<T, ::Point<T::dimension, float>> ||
530 std::is_same_v<T, ::Point<T::dimension, double>> ||
531 std::is_same_v<T, ::BoundingBox<T::dimension, float>> ||
532 std::is_same_v<T, ::BoundingBox<T::dimension, double>> ||
533 std::is_same_v<T, std::pair<::Point<T::dimension, float>,
float>> ||
535 std::pair<::Point<T::dimension, double>,
double>>>>::
536 get(
const std::vector<T> &v, std::size_t i)
544# include "arborx/access_traits.inst"