JuliaRandom / RandomNumbers.jl

Random Number Generators for the Julia Language.
https://juliarandom.github.io/RandomNumbers.jl/stable
Other
97 stars 23 forks source link

Default inner constructor #79

Closed YingboMa closed 3 years ago

sunoru commented 3 years ago

Hi, thanks for the pr, but I'm sorry I couldn't get what this inner constructor is for... Doesn't it make all Xoroshiro128(x, y) calls from outside return a Xoroshiro128(0, 0)?

YingboMa commented 3 years ago

Oh, right. It should be new(x, y), shouldn't it.

sunoru commented 3 years ago

Yeah. Why is this necessary?

YingboMa commented 3 years ago

So it's copy-paste-able from the printing

julia> Xorshifts.Xoroshiro128()
RandomNumbers.Xorshifts.Xoroshiro128(0x862c413b9d2f217c, 0x5ce0ec59c094162b)

julia> RandomNumbers.Xorshifts.Xoroshiro128(0x862c413b9d2f217c, 0x5ce0ec59c094162b)
RandomNumbers.Xorshifts.Xoroshiro128(0x862c413b9d2f217c, 0x5ce0ec59c094162b)
ChrisRackauckas commented 3 years ago

It's a standard across Julia for 2-argument show methods to be round-trippable.

sunoru commented 3 years ago

Oh I see, I didn't realize this method is not automatically generated.

ChrisRackauckas commented 3 years ago

Could this please get a tag?