diff --git a/Project.toml b/Project.toml index 51cbcab..ad3e7b0 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "LorentzVectors" uuid = "3f54b04b-17fc-5cd4-9758-90c048d965e3" authors = ["Jean-Loup Tastet "] -version = "0.4.0" +version = "0.4.1" [deps] LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" diff --git a/src/LorentzVectors.jl b/src/LorentzVectors.jl index 3454d7e..1a6abdd 100644 --- a/src/LorentzVectors.jl +++ b/src/LorentzVectors.jl @@ -3,7 +3,7 @@ __precompile__() module LorentzVectors import LinearAlgebra: dot, ⋅, cross, ×, norm, normalize -import Random: rand, MersenneTwister +import Random: rand, AbstractRNG import Base: +, -, *, /, ==, isapprox, ≈, zero @@ -216,7 +216,7 @@ end """ rand(rng, SpatialVector) """ -function rand(r::MersenneTwister, ::Type{V}) where {U <: Real, V <: SpatialVector{U}} +function rand(r::AbstractRNG, ::Type{V}) where {U <: Real, V <: SpatialVector{U}} cθ = 2*rand(r, U) - 1 sθ = sqrt(1-cθ^2) φ = 2π * rand(r, U)