Skip to content

Commit

Permalink
further test coverage.
Browse files Browse the repository at this point in the history
  • Loading branch information
kellertuer committed Oct 30, 2024
1 parent 81fd436 commit bd969b9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 2 additions & 3 deletions src/group_operations/multiplication_operation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -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
Expand Down
4 changes: 3 additions & 1 deletion test/operations/test_multiplication_operation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit bd969b9

Please sign in to comment.