From 759f031f8c722770abb5d15fc11715970cc2fc07 Mon Sep 17 00:00:00 2001 From: Moelf Date: Wed, 26 Jul 2023 19:25:43 -0400 Subject: [PATCH] widen type constraint for AD --- Project.toml | 2 +- src/cylindrical.jl | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Project.toml b/Project.toml index 0274c6c..110e5b0 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "LorentzVectorHEP" uuid = "f612022c-142a-473f-8cfd-a09cf3793c6c" authors = ["Jerry Ling and contributors"] -version = "0.1.4" +version = "0.1.5" [deps] LorentzVectors = "3f54b04b-17fc-5cd4-9758-90c048d965e3" diff --git a/src/cylindrical.jl b/src/cylindrical.jl index 14c6899..c2aefdb 100644 --- a/src/cylindrical.jl +++ b/src/cylindrical.jl @@ -1,9 +1,10 @@ -struct LorentzVectorCyl{T <: AbstractFloat} +struct LorentzVectorCyl{T <: Number} pt::T eta::T phi::T mass::T end +LorentzVectorCyl(pt, eta, phi, mass) = LorentzVectorCyl(promote(pt, eta, phi, mass)...) Base.show(io::IO, v::LorentzVectorCyl) = print(io, "$(typeof(v))(pt=$(v.pt), eta=$(v.eta), phi=$(v.phi), mass=$(v.mass))")