Skip to content

Commit

Permalink
Fix type casting issue
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonReinhard committed Jun 6, 2024
1 parent c71bd8a commit 310edb2
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/interfaces/lorentz_vectors/arithmetic.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
# TODO: these overloads shouldn't be necessary, but are for some reason
@inline function *(L::TL, NUM::Number) where {TL<:AbstractLorentzVector}
return constructorof(TL)(L[1] * NUM, L[2] * NUM, L[3] * NUM, L[4] * NUM)
end

@inline function *(NUM::Number, L::TL) where {TL<:AbstractLorentzVector}
return constructorof(TL)(L[1] * NUM, L[2] * NUM, L[3] * NUM, L[4] * NUM)
end

@inline function /(L::TL, NUM::Number) where {TL<:AbstractLorentzVector}
return constructorof(TL)(L[1] / NUM, L[2] / NUM, L[3] / NUM, L[4] / NUM)
end

function dot(p1::T1, p2::T2) where {T1<:AbstractLorentzVector,T2<:AbstractLorentzVector}
return mdot(p1, p2)
end
Expand Down

0 comments on commit 310edb2

Please sign in to comment.