Copying from bob-carpenter/walnuts#19
https://github.com/flatironinstitute/walnuts/blob/fb09dd05fa9c654a51b4c93878e40911bebdf929/include/walnuts/walnuts.hpp#L361
For depth = 0 in transition we do not need to construct the full span we get from build_leaf. And in build_span when depth == 1 we can call build_leaf directly instead of going to 0. Both of these changes should give us a small speedup, but we should wait until the algo is more tested before doing that.
EDIT: The minimum size span we should need is two nodes---one node cannot make a U-turn. But it makes the edge cases in the code very messy, so let's put this off until we need it.
Copying from bob-carpenter/walnuts#19
https://github.com/flatironinstitute/walnuts/blob/fb09dd05fa9c654a51b4c93878e40911bebdf929/include/walnuts/walnuts.hpp#L361
For
depth = 0intransitionwe do not need to construct the fullspanwe get frombuild_leaf. And inbuild_spanwhendepth == 1we can callbuild_leafdirectly instead of going to 0. Both of these changes should give us a small speedup, but we should wait until the algo is more tested before doing that.EDIT: The minimum size span we should need is two nodes---one node cannot make a U-turn. But it makes the edge cases in the code very messy, so let's put this off until we need it.