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

Add support for RealDot #119

Merged
merged 14 commits into from
Dec 16, 2022
Prev Previous commit
Next Next commit
add commutative law test for real∘dot
hyrodium committed Dec 15, 2022
commit 204e32079a8512db0d022a0f4b5706cc08df898e
5 changes: 5 additions & 0 deletions test/Quaternion.jl
Original file line number Diff line number Diff line change
@@ -576,8 +576,13 @@ end
for _ in 1:10
q1 = randn(Quaternion{T})
q2 = randn(Quaternion{T})
# Check real∘dot is equal to realdot.
@test real(dot(q1,q2)) == @inferred(realdot(q1,q2))
# Check realdot is commutative.
@test realdot(q1,q2) == realdot(q2,q1)
# Check real∘dot is also commutative just in case.
@test real(dot(q1,q2)) == real(dot(q2,q1))
# Check the return type of realdot is correct.
@test realdot(q1,q2) isa T
end
end