-
Notifications
You must be signed in to change notification settings - Fork 57
Feature: Ancestor search #1714
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Feature: Ancestor search #1714
Conversation
…docstring still missing
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1714 +/- ##
==========================================
- Coverage 74.06% 73.88% -0.18%
==========================================
Files 99 99
Lines 18616 18667 +51
==========================================
+ Hits 13788 13793 +5
- Misses 4828 4874 +46 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A first round of remarks! Thanks for this addition!
@@ -57,6 +57,14 @@ t8_forest_get_tree_leaf_element_array_mutable (const t8_forest_t forest, t8_loci | |||
return (t8_element_array_t *) t8_forest_get_tree_leaf_element_array (forest, ltreeid); | |||
} | |||
|
|||
/* TODO: does the search fail when element_level is smaller then levels in the array? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you opened issues for these Todos? That way they do not get lost that easily.
|
||
/* In case we do not find an element that is greater than the given element_id, the binary search returns | ||
* the end-iterator of the element array. */ | ||
if (elem_iter == t8_element_array_end (elements)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should be consistent here with the std and return the index of the last element if no such element exist.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
additional remark, but maybe not necessary to react. I would find it more logical to also use std::upper_bound in that case. I know with the right lambda they are equivalent, but it feels right.
*/ | ||
// TODO: Move this function to the scheme class. | ||
static bool | ||
t8_forest_element_is_ancestor (const t8_scheme *scheme, t8_eclass_t eclass, const t8_element_t *element_A, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
t8_forest_element_is_ancestor (const t8_scheme *scheme, t8_eclass_t eclass, const t8_element_t *element_A, | |
t8_forest_element_is_ancestor (const t8_scheme *scheme, const t8_eclass_t eclass, const t8_element_t *element_A, |
} | ||
} | ||
|
||
/** Query whether one element is an ancestor of the other. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/** Query whether one element is an ancestor of the other. | |
/** Query whether element A is an ancestor of the element B. |
Otherwise it sounds like both possibilities are checked, but this is not the case, as far as I understand the code.
Closes #1715
Describe your changes here:
Currently waiting for #1640 to merge.
Will add a description afterwards.
All these boxes must be checked by the AUTHOR before requesting review:
Documentation:
,Bugfix:
,Feature:
,Improvement:
orOther:
.All these boxes must be checked by the REVIEWERS before merging the pull request:
As a reviewer please read through all the code lines and make sure that the code is fully understood, bug free, well-documented and well-structured.
General
Tests
If the Pull request introduces code that is not covered by the github action (for example coupling with a new library):
Scripts and Wiki
script/find_all_source_files.scp
to check the indentation of these files.License
doc/
(or already has one).