-
-
Notifications
You must be signed in to change notification settings - Fork 40
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
Inverse not defined for MBlade? #13
Comments
Currently, the implementation of |
A naive implementation would be the following formula julia> using Grassmann; basis"3"
(⟨+++⟩, v, v₁, v₂, v₃, v₁₂, v₁₃, v₂₃, v₁₂₃)
julia> Base.inv(a::TensorAlgebra) = (A=~a; A/(A⋅a))
julia> inv(v1+v2)
0.0 + 0.5v₁ + 0.5v₂ However, a more optimized method could also be defined, similar to the other operations. |
The |
The julia> 1/(0v+2v1)
0.0 + 0.5v₁
julia> @btime inv(0v+2v1)
5.677 μs (80 allocations: 4.81 KiB)
0.0 + 0.5v₁
julia> @btime inv(2v1)
62.522 ns (4 allocations: 64 bytes)
0.5v₁
julia> @btime inv(0v2+2v1)
136.415 ns (6 allocations: 128 bytes)
0.5v₁ + 0.0v₂ + 0.0v₃ However, it is much slower for an arbitrary This may be improved in the future with the |
I'm trying to calculate the inverse of a blade with
Grassmann v0.1.3
:Is this function missing, or am I looking in the wrong place?
The text was updated successfully, but these errors were encountered: