Skip to content
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

lp_sum creates a linked list instead of a balanced tree #65

Closed
lovasoa opened this issue Feb 10, 2021 · 0 comments · Fixed by #66
Closed

lp_sum creates a linked list instead of a balanced tree #65

lovasoa opened this issue Feb 10, 2021 · 0 comments · Fixed by #66

Comments

@lovasoa
Copy link
Contributor

lovasoa commented Feb 10, 2021

lp_sum returns a deeply imbalanced expression tree of the form AddExpr(a, AddExpr(b, AddExpr(c, AddExpr(d)))), which then causes stack overflows when being processed by simplify (see #37).

lp_sum could return a balanced tree of depth log2(n) (instead of n), which would be less likely to cause stack overflows during processing.

@lovasoa lovasoa mentioned this issue Feb 10, 2021
@jcavat jcavat closed this as completed in 7293e97 Feb 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant