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

merge numbers when operation reaches the full precision #11

Open
Laouen opened this issue Jul 10, 2018 · 2 comments
Open

merge numbers when operation reaches the full precision #11

Laouen opened this issue Jul 10, 2018 · 2 comments
Assignees
Labels
After GSoC To implement before submitting to Boost C++ for inclusion

Comments

@Laouen
Copy link
Collaborator

Laouen commented Jul 10, 2018

As done in path compression, whenever a number iterator is increased and the calculated number entire representation is reached (lower bound is equal to upper bound), then the real number is converted to a real_explicit with the calculated number and the children are destroyed.

This can improve performance to reduce both memory and recursive calls

@Laouen Laouen added the After GSoC To implement before submitting to Boost C++ for inclusion label Jul 10, 2018
@Laouen Laouen self-assigned this Jul 10, 2018
@sdavtaker
Copy link
Contributor

For this to work the leaves below that node have to all be real_explicit

@Laouen
Copy link
Collaborator Author

Laouen commented Jul 12, 2018

That's correct, but once a real_operation is merged and it has been converted to a single real_explicit, then the parent real_operation node could also be merged, in the best case scenario, the whole tree is reduced to a single real_explicit.

Similar to path compression, this can be made when an iterator is increased and its two boundaries (lower and upper) have the exact same value, if that is the case, the iterator has reached the number full precision and the number can be merged. For this purpose, we can declare a non-const iterator, an iterator that has this behaviour as a side effect. The current iterator is const and cannot modify the pointed number. The user will choose which one fits best for his needs.

@Laouen Laouen changed the title Implement min_precision to merge numbers merge numbers when operation reaches the full precision Aug 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
After GSoC To implement before submitting to Boost C++ for inclusion
Projects
None yet
Development

No branches or pull requests

2 participants