-
Notifications
You must be signed in to change notification settings - Fork 12
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
Ladderize results C stack usage overflow #54
Comments
I could make a pull request to fix this behavior, EDIT: Sorry, I misread Teng's comment above. I'll check this now. The function is here: https://github.com/emmanuelparadis/ape/blob/master/R/ladderize.R#L12-L27 We could maybe fix this pretty quickly with a trampoline, using this package: https://github.com/rdinnager/trampoline Something like the following at https://github.com/emmanuelparadis/ape/blob/master/R/ladderize.R#L36 after
UPDATE: It might be useful to have another look at the logic here @KlausVigo @emmeanuelparadis I've found the trampoline idea to be not as straightforward as I hoped. We should probably try to rewrite the above using iteration... |
Hi @teng-gao, |
Hi all, PS: @teng-gao the tree you send contains ~2x too many |
Just tested the iterative version by @KlausVigo and it works on my case! |
Thanks @KlausVigo I commented on the PR. Works for me as well---I wouldn't have been able to so quickly solve this. There's a warning but that's probably ok. Thanks, Evan |
Excellent! I've merged Klaus's PR. I'm now working on removing the recursive call from |
Hi Emmanuel,
We found that for certain tree structures,
ladderize
function results in C stack overflow. For example,tree.rds.zip
This seems to result from the recursive
foo
function to reorder edges. Do you think there is an easy fix to this? Would really appreciate your help.Thanks,
Teng
The text was updated successfully, but these errors were encountered: