From bd969b9919d42edc69d80cadaa1cad257d2ef6ba Mon Sep 17 00:00:00 2001 From: Ronny Bergmann Date: Wed, 30 Oct 2024 10:15:25 +0100 Subject: [PATCH] further test coverage. --- src/group_operations/multiplication_operation.jl | 5 ++--- test/operations/test_multiplication_operation.jl | 4 +++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/group_operations/multiplication_operation.jl b/src/group_operations/multiplication_operation.jl index 26e93e4..c309144 100644 --- a/src/group_operations/multiplication_operation.jl +++ b/src/group_operations/multiplication_operation.jl @@ -14,7 +14,6 @@ A group operation that is realised by a matrix multiplication. """ struct MatrixMultiplicationGroupOperation <: AbstractMultiplicationGroupOperation end -Base.:*(e::Identity{<:AbstractMultiplicationGroupOperation}) = e Base.:*(::Identity{MatrixMultiplicationGroupOperation}, p::Union{AbstractMatrix,Number}) = p function Base.:*( p::Union{AbstractMatrix,Number}, ::Identity{MatrixMultiplicationGroupOperation} @@ -28,12 +27,12 @@ function Base.:*( return e end function Base.:*( - ::Identity{<:AbstractMultiplicationGroupOperation}, e::Identity{AdditionGroupOperation} + e::Identity{<:AbstractMultiplicationGroupOperation}, ::Identity{AdditionGroupOperation} ) return e end function Base.:*( - e::Identity{AdditionGroupOperation}, ::Identity{<:AbstractMultiplicationGroupOperation} + ::Identity{AdditionGroupOperation}, e::Identity{<:AbstractMultiplicationGroupOperation} ) return e end diff --git a/test/operations/test_multiplication_operation.jl b/test/operations/test_multiplication_operation.jl index 45a51d3..634782c 100644 --- a/test/operations/test_multiplication_operation.jl +++ b/test/operations/test_multiplication_operation.jl @@ -16,9 +16,11 @@ using LieGroups, Test @test (e \ e) === e @test inv(e) === e @test det(e) + ea = Identity(AdditionGroupOperation) + @test ea * e === e + @test e * ea === e # Zero array g2 = fill(2.0, ()) - # Array g3 = [2.0 0.0; 0.0 2.0] end