-
-
Notifications
You must be signed in to change notification settings - Fork 208
Use boost multiprecision for GJK #3770
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
Conversation
Have you tested this on: #3653 In general, it seems like you have rewritten the algorithm quite a bit. Could you comment on why and how it improves the situation (of course higher precision helps). |
Yes it works, the answer is: I tried to make the algorithm clearer - there are some comments throughout. It is possible there is more simplification that can be done. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks nice. Multiprecision is header only and we already require boost so that's good.
Do we want the caller to be able to control the internal precision?
It would be easy to add a template parameter for the internal precision, good for c++, but probably not so much for Python. We could use presets for double and float, I guess. The functions are already in |
On oneapi seems to be dispatching to float32 incorrectly... |
|
I think we should add a test covering the co-planar case (#3653) so that we don't hit this again, other than that, looks good. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feels a little bit arbitrary. Do we really understand where and why extra precision is needed?
Are we sure that the nanobind interface wasn't casting to lower precision?
What's the performance cost? It could be high for the extended precision.
To answer those questions:
|
We should look at unifying the math functions in another PR - with C++ concepts it should be straightforward. It's not clear to me that we would want to handle increasing precision within the function - shouldn't this be under the control of the caller handling an exception/error code? |
Yes, I agree with the second point. I would like to merge this for now - we can create some actions/issues to address these remaining items. Perhaps it should return a value to indicate (non)convergence, rather than throwing an error. |
Probably the latter because I'd consider non-convergence 'normal' rather than exceptional behaviour. Unfortunately we don't have std::expected in C++20 (C++23). |
In principle fine, but in practice the details never get fixed later. |
No description provided.