Skip to content

Commit 12cc772

Browse files
yo35BotellaA
authored andcommitted
fix(AABBTree): wrong parallelization scheme in containing_boxes(..)
1 parent 08b5f57 commit 12cc772

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

include/geode/geometry/detail/aabb_impl.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ namespace geode
8181
return morton_mapping< dimension >( points );
8282
}() )
8383
{
84+
index_t depth = 1;
8485
if( bboxes.empty() )
8586
{
8687
tree_.resize( ROOT_INDEX );
@@ -90,7 +91,7 @@ namespace geode
9091
const auto [max_node_index, max_depth] =
9192
max_node_index_recursive( ROOT_INDEX, 0, bboxes.size(), 0 );
9293
tree_.resize( ROOT_INDEX + max_node_index );
93-
depth_ = max_depth;
94+
depth = max_depth;
9495
initialize_tree_recursive(
9596
bboxes, ROOT_INDEX, 0, bboxes.size() );
9697
}
@@ -102,7 +103,7 @@ namespace geode
102103
else
103104
{
104105
const auto nb_async_depth = std::log2( grain );
105-
async_depth_ = depth_ - nb_async_depth;
106+
async_depth_ = depth - nb_async_depth;
106107
}
107108
}
108109

@@ -538,7 +539,7 @@ namespace geode
538539
}
539540
const auto it = get_recursive_iterators(
540541
node_index, element_begin, element_end );
541-
if( depth_ > async_depth_ )
542+
if( depth > async_depth_ )
542543
{
543544
containing_boxes_recursive( it.child_left, element_begin,
544545
it.element_middle, depth + 1, query, result, mutex );
@@ -560,7 +561,6 @@ namespace geode
560561
private:
561562
std::vector< BoundingBox< dimension > > tree_;
562563
std::vector< index_t > mapping_morton_;
563-
index_t depth_{ 1 };
564564
index_t async_depth_{ 0 };
565565
bool parallel_{ true };
566566
};

0 commit comments

Comments
 (0)