Use binary search in Axis_group_interface::combine_pure_heights. (issue 573730043 by hanwenn@gmail.com)

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Use binary search in Axis_group_interface::combine_pure_heights. (issue 573730043 by hanwenn@gmail.com)

Dev mailing list
Reply | Threaded
Open this post in threaded view
|

Re: Use binary search in Axis_group_interface::combine_pure_heights. (issue 573730043 by hanwenn@gmail.com)

jonas.hahnfeld
LGTM otherwise


https://codereview.appspot.com/573730043/diff/567470043/lily/axis-group-interface.cc
File lily/axis-group-interface.cc (right):

https://codereview.appspot.com/573730043/diff/567470043/lily/axis-group-interface.cc#newcode206
lily/axis-group-interface.cc:206: auto it = lower_bound
(break_ranks.begin (), break_ranks.end (), start);
Could you add a comment that break_ranks is sorted by construction in
Paper_score::find_break_indices() -- if that is true: I had a quick look
at the code and this seems the most likely explanation why a binary
search is legit.  But please double check and let me know if that guess
is correct.

https://codereview.appspot.com/573730043/

Reply | Threaded
Open this post in threaded view
|

Re: Use binary search in Axis_group_interface::combine_pure_heights. (issue 573730043 by hanwenn@gmail.com)

Han-Wen Nienhuys-3
In reply to this post by Dev mailing list
Reply | Threaded
Open this post in threaded view
|

Re: Use binary search in Axis_group_interface::combine_pure_heights. (issue 573730043 by hanwenn@gmail.com)

Han-Wen Nienhuys-3
In reply to this post by Dev mailing list
On 2020/04/21 09:15:28, hahnjo wrote:
> LGTM otherwise
>
>
https://codereview.appspot.com/573730043/diff/567470043/lily/axis-group-interface.cc
> File lily/axis-group-interface.cc (right):
>
>
https://codereview.appspot.com/573730043/diff/567470043/lily/axis-group-interface.cc#newcode206
> lily/axis-group-interface.cc:206: auto it = lower_bound
(break_ranks.begin (),
> break_ranks.end (), start);
> Could you add a comment that break_ranks is sorted by construction in
> Paper_score::find_break_indices() -- if that is true: I had a quick
look at the
> code and this seems the most likely explanation why a binary search is
legit.
> But please double check and let me know if that guess is correct.

added a comment to paper-score.hh

https://codereview.appspot.com/573730043/

Reply | Threaded
Open this post in threaded view
|

Re: Use binary search in Axis_group_interface::combine_pure_heights. (issue 573730043 by hanwenn@gmail.com)

Han-Wen Nienhuys-3
In reply to this post by Dev mailing list