-
Notifications
You must be signed in to change notification settings - Fork 37
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
Add support for RealDot
#119
Conversation
Codecov Report
@@ Coverage Diff @@
## main #119 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 1 1
Lines 135 136 +1
=========================================
+ Hits 135 136 +1
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
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.
LGTM, just some minor suggestions.
There are 2 places in the code where we might consider using realdot
:
Base.abs2(q::Quaternion) = RealDot.realdot(q, q)
# in slerp
coshalftheta = RealDot.realdot(qa, qb)
Merge with a patch version bump when you feel it's ready.
Co-authored-by: Seth Axen <[email protected]>
Replacing
Do you have any thoughts on this? |
I think this makes the most sense. |
I am going to suggest that EDIT: |
It should be
Even if the compiler manages to not calculate the imaginary part, it's still worth having these overloads, because common code transformations, such as automatic differentiation still happen at an earlier step in compilation process; the resulting code is more complex, and the compiler might not be able to eliminate the unused branch. Plus we support older Julia versions as well, and the downsides to implementing |
Thank you for the comments! This PR is ready for final review. |
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.
I think we also said that we could use realdot
for abs2
?
Co-authored-by: Seth Axen <[email protected]>
Co-authored-by: Seth Axen <[email protected]>
Oh, sorry, I was forgetting that. I have updated that:+1: |
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.
LGTM, thanks! Just please increment the patch version and make a patch release.
This PR adds
RealDot.realdot(::Quaternion, ::Quaternion)
as suggested in #58 (comment).