-
Notifications
You must be signed in to change notification settings - Fork 13
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
Mutable quaternion? #27
Comments
Hi @mattsignorelli ! I am glad that ReferenceFrameRotations.jl is being useful :) One of the reasons for the speed of this package is because all the types are immutable. Can you please highlight why do you need a mutable quaternion? Furthermore, did you check Accessors.jl? Using this package, it is possible to do this: julia> using ReferenceFrameRotations
julia> using Accessors
julia> function test()
q = Quaternion(1, 2, 3, 4)
@reset q.q0 = 10
return q
end
test (generic function with 1 method)
julia> test()
Quaternion{Int64}:
+ 10 + 2⋅i + 3⋅j + 4⋅k It automatically creates a copy with the new field. In most of cases, it is significantly faster than using a mutable structure. |
Hello! The idea is that we'd have a separate type, We are currently planning for our accelerator physics simulation API to be mutating, because instead of just simulating particles going through the accelerator (which could basically just be The |
I see, sounds very reasonable! :) Can you make a PR? We just need to make sure we did not decrease the performance of the previous version. |
Sure! I'll get started on it now |
Awesome! |
By the way! When coding, please, if possible, follow the BlueStyle: https://github.com/JuliaDiff/BlueStyle |
Sounds good! It might take a couple weeks to finish since I'm a bit swamped right now but it's on my to-do list |
My organization has a need for a mutable quaternion. We really like this package as a lightweight, fast quaternion implementation for simulations, and we were wondering if a PR would be accepted where we implement a
MQuaternion
which is mutable, and have bothQuaternion
andMQuaternion
inherit from someAbstractQuaternion
, which the current function type definitions would then use. This would have no impact on current users of the package but also expand its functionalityThe text was updated successfully, but these errors were encountered: