Skip to content

Commit

Permalink
FIXES #5: Define the rand method for an AbstractRNG instead of Mers…
Browse files Browse the repository at this point in the history
…enneTwister.
  • Loading branch information
JLTastet committed Jun 7, 2021
1 parent ab74c55 commit dbc8922
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "LorentzVectors"
uuid = "3f54b04b-17fc-5cd4-9758-90c048d965e3"
authors = ["Jean-Loup Tastet <[email protected]>"]
version = "0.4.0"
version = "0.4.1"

[deps]
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Expand Down
4 changes: 2 additions & 2 deletions src/LorentzVectors.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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}}
= 2*rand(r, U) - 1
= sqrt(1-^2)
φ = 2π * rand(r, U)
Expand Down

2 comments on commit dbc8922

@JLTastet
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/83702

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.4.1 -m "<description of version>" dbc8922f64c218a7a5101552856b395cb4658272
git push origin v0.4.1

Please sign in to comment.