renaming _3 functors in CollectionPartitioningOrthtreeTraits to _d

This commit is contained in:
Sven Oesau 2024-02-27 10:26:50 +01:00
parent 99104e5699
commit 84d17b6099
3 changed files with 17 additions and 17 deletions

View File

@ -54,7 +54,7 @@ public:
* Provides the operator:
* `Sphere_d operator()(const Point_d&, const FT&)`
*/
using Construct_sphere_3 = unspecified_type;
using Construct_sphere_d = unspecified_type;
/*!
* \brief Functor with an operator that provides the center of a `Sphere_d`.
@ -62,7 +62,7 @@ public:
* Provides the operator:
* `Point_d operator()(const Sphere_d&)`
*/
using Construct_center_3 = unspecified_type;
using Construct_center_d = unspecified_type;
/*!
* \brief Functor with an operator that provides the squared radius of a `Sphere_d`.
@ -70,7 +70,7 @@ public:
* Provides the operator:
* `FT operator()(const Sphere_d&)`
*/
using Compute_squared_radius_3 = unspecified_type;
using Compute_squared_radius_d = unspecified_type;
/// @}
@ -78,19 +78,19 @@ public:
/// @{
/*!
* constructs an object of type `ConstructSphere_3`.
* constructs an object of type `ConstructSphere_d`.
*/
Construct_sphere_3 construct_sphere_3_object() const;
Construct_sphere_d construct_sphere_d_object() const;
/*!
* constructs an object of type `ConstructCenter_3`.
* constructs an object of type `ConstructCenter_d`.
*/
Construct_center_3 construct_center_3_object() const;
Construct_center_d construct_center_d_object() const;
/*!
* constructs an object of type `ComputeSquaredRadius_3`.
* constructs an object of type `ComputeSquaredRadius_d`.
*/
Compute_squared_radius_3 compute_squared_radius_3_object() const;
Compute_squared_radius_d compute_squared_radius_d_object() const;
/*!
* constructs an object of type `Squared_distance_of_element`.

View File

@ -39,10 +39,10 @@ void nearest_k_neighbors_recursive(const Tree& orthtree,
// Pair that element with its distance from the search point
Result current_element_with_distance =
{e, orthtree.traits().squared_distance_of_element_object()(e, orthtree.traits().construct_center_3_object()(search_bounds))};
{e, orthtree.traits().squared_distance_of_element_object()(e, orthtree.traits().construct_center_d_object()(search_bounds))};
// Check if the new element is within the bounds
if (current_element_with_distance.distance < orthtree.traits().compute_squared_radius_3_object()(search_bounds)) {
if (current_element_with_distance.distance < orthtree.traits().compute_squared_radius_d_object()(search_bounds)) {
// Check if the results list is full
if (results.size() == results.capacity()) {
@ -63,7 +63,7 @@ void nearest_k_neighbors_recursive(const Tree& orthtree,
if (results.size() == results.capacity()) {
// Set the search radius
search_bounds = orthtree.traits().construct_sphere_3_object()(orthtree.traits().construct_center_3_object()(search_bounds), results.back().distance + epsilon);
search_bounds = orthtree.traits().construct_sphere_d_object()(orthtree.traits().construct_center_d_object()(search_bounds), results.back().distance + epsilon);
}
}
}
@ -90,7 +90,7 @@ void nearest_k_neighbors_recursive(const Tree& orthtree,
Orthtrees::internal::Cartesian_ranges<typename Tree::Traits> cartesian_range;
typename Tree::FT squared_distance = 0;
for (const auto& r : cartesian_range(orthtree.traits().construct_center_3_object()(search_bounds), orthtree.barycenter(child_node))) {
for (const auto& r : cartesian_range(orthtree.traits().construct_center_d_object()(search_bounds), orthtree.barycenter(child_node))) {
typename Tree::FT d = (get<0>(r) - get<1>(r));
squared_distance += d * d;
}
@ -191,7 +191,7 @@ template <typename Tree, typename OutputIterator>
OutputIterator nearest_neighbors(const Tree& orthtree, const typename Tree::Point& query,
std::size_t k,
OutputIterator output) {
typename Tree::Sphere query_sphere = orthtree.traits().construct_sphere_3_object()(query, (std::numeric_limits<typename Tree::FT>::max)());
typename Tree::Sphere query_sphere = orthtree.traits().construct_sphere_d_object()(query, (std::numeric_limits<typename Tree::FT>::max)());
return nearest_k_neighbors_in_radius(orthtree, query_sphere, k, output);
}

View File

@ -167,19 +167,19 @@ public:
};
}
auto construct_sphere_3_object() const {
auto construct_sphere_d_object() const {
return [](const typename Self::Point_d& center, const typename Self::FT& squared_radius) -> typename Self::Sphere_d {
return typename Self::Sphere_d(center, squared_radius);
};
}
auto construct_center_3_object() const {
auto construct_center_d_object() const {
return [](const typename Self::Sphere_d& sphere) -> typename Self::Point_d {
return sphere.center();
};
}
auto compute_squared_radius_3_object() const {
auto compute_squared_radius_d_object() const {
return [](const typename Self::Sphere_d& sphere) -> typename Self::FT {
return sphere.squared_radius();
};