Merge remote-tracking branch 'origin/orthtree-generalization' into orthtree-generalization

This commit is contained in:
JacksonCampolattaro 2023-10-08 15:05:55 +02:00
commit 1b5ebd3a07
4 changed files with 10 additions and 7 deletions

View File

@ -23,7 +23,7 @@ int main() {
points.emplace_back(-1, 1, 1); points.emplace_back(-1, 1, 1);
// Create an octree from the points // Create an octree from the points
Octree octree({points}); Octree octree(points);
// Build the octree // Build the octree
octree.refine(10, 1); octree.refine(10, 1);

View File

@ -30,7 +30,7 @@ int main() {
points.emplace_back(-1.0001, 1, 1); points.emplace_back(-1.0001, 1, 1);
// Create an octree from the points // Create an octree from the points
Octree octree({points}); Octree octree(points);
// Build the octree with a small bucket size, so we get a deep node // Build the octree with a small bucket size, so we get a deep node
octree.refine(10, 2); octree.refine(10, 2);

View File

@ -18,7 +18,7 @@ int main()
points_2d.emplace_back(r.get_double(-1., 1.), points_2d.emplace_back(r.get_double(-1., 1.),
r.get_double(-1., 1.)); r.get_double(-1., 1.));
Quadtree quadtree({points_2d}); Quadtree quadtree(points_2d);
quadtree.refine(10, 5); quadtree.refine(10, 5);
return EXIT_SUCCESS; return EXIT_SUCCESS;

View File

@ -106,7 +106,7 @@ public:
} }
virtual void move(Property_array_base<Index>&& other_base) override { virtual void move(Property_array_base<Index>&& other_base) override {
auto&& other = dynamic_cast<Property_array<Index, T>&&>(other_base); auto&& other = static_cast<Property_array<Index, T>&&>(other_base);
m_data = std::move(other.m_data); m_data = std::move(other.m_data);
CGAL_precondition(m_active_indices.size() == m_data.size()); CGAL_precondition(m_active_indices.size() == m_data.size());
} }
@ -489,10 +489,13 @@ public:
[](bool used) { return !used; } [](bool used) { return !used; }
); );
auto unused_end = unused_begin;
// Determine if the group fits // Determine if the group fits
auto unused_end = std::find_if( if (std::distance(unused_begin, m_active_indices.end()) >= n)
unused_begin, std::min(unused_begin + n, m_active_indices.end()), unused_end = std::find_if(
[](bool used) { return used; } unused_begin, std::min(unused_begin + n, m_active_indices.end()),
[](bool used) { return used; }
); );
// If the discovered range was large enough // If the discovered range was large enough