Skip to content

Commit

Permalink
[paving] added nb_leaves
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonRohou committed Nov 10, 2023
1 parent c8fe9ec commit 0a8fa74
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/core/2/domains/paving/codac2_Paving.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,15 @@ namespace codac2
return l;
}

size_t nb_leaves() const
{
if(is_leaf())
return 1;
else
return (_left ? _left->nb_leaves() : 0) +
(_right ? _right->nb_leaves() : 0);
}

protected:

void boxes_list_push(std::list<std::reference_wrapper<const IntervalVector_<N>>>& l, const IntervalVector_<N>& intersect = IntervalVector_<N>()) const
Expand Down

0 comments on commit 0a8fa74

Please sign in to comment.