removing Locate_halfspace

This commit is contained in:
Sven Oesau 2024-01-31 16:22:40 +01:00
parent a9a37c1d0e
commit ecc30d8b0f
3 changed files with 3 additions and 18 deletions

View File

@ -70,14 +70,6 @@ public:
*/ */
using Construct_root_node_contents = unspecified_type; using Construct_root_node_contents = unspecified_type;
/*!
* \brief Functor to locate in which halfspace a number of type `FT` is located with respect to another number of type `FT`.
*
* The functor is used by `Orthtree::locate()` to identify in which leaf node a point is located.
* `Distribute_node_contents` must use `Locate_halfspace` to guarantee consistency wich `Orthtree::locate()`.
*/
using Locate_halfspace = unspecified_type;
/*! /*!
* \brief Functor which distributes a node's contents to its children. * \brief Functor which distributes a node's contents to its children.
* *
@ -120,11 +112,6 @@ public:
*/ */
Distribute_node_contents distribute_node_contents_object() const; Distribute_node_contents distribute_node_contents_object() const;
/*!
* constructs an object of type `Locate_halfspace`.
*/
Locate_halfspace locate_halfspace_object() const;
/*! /*!
* constructs an object of type `Construct_point_d`. * constructs an object of type `Construct_point_d`.
*/ */

View File

@ -607,7 +607,7 @@ public:
Local_coordinates local_coords; Local_coordinates local_coords;
std::size_t dim = 0; std::size_t dim = 0;
for (const auto& r : cartesian_range(center, point)) for (const auto& r : cartesian_range(center, point))
local_coords[dim++] = m_traits.locate_halfspace_object()(get<0>(r), get<1>(r)); local_coords[dim++] = (get<0>(r) <= get<1>(r));
// Find the correct sub-node of the current node // Find the correct sub-node of the current node
node_for_point = child(node_for_point, local_coords.to_ulong()); node_for_point = child(node_for_point, local_coords.to_ulong());

View File

@ -42,9 +42,7 @@ void reassign_points(
auto split_point = std::partition( auto split_point = std::partition(
points.begin(), points.end(), points.begin(), points.end(),
[&](const auto& p) -> bool { [&](const auto& p) -> bool {
// This should be done with cartesian iterator, return (get(point_map, p)[int(dimension)] < center[int(dimension)]);
// but it seems complicated to do efficiently
return traits.locate_halfspace_object()(get(point_map, p)[int(dimension)], center[int(dimension)]);
} }
); );