@@ -50,7 +50,7 @@ macro make_container(margs...)
5050 end
5151 end
5252 for def in (:(rand (rng:: AbstractRNG ) where {} = rand (rng, make ())),
53- :(rand () where {} = rand (GLOBAL_RNG , make ())))
53+ :(rand () where {} = rand (default_rng () , make ())))
5454 append! (def. args[1 ]. args[1 ]. args, filter (!= (()), as1))
5555 as2 = copy (as1)
5656 as2[1 ], as2[2 ] = as2[2 ], as2[1 ]
9595
9696macro make_array_container (Cont)
9797 definitions =
98- [ :(rand (rng:: AbstractRNG , $ Cont, dims:: Dims ) = rand (rng, _make_cont (t, dims))),
99- :(rand ( $ Cont, dims:: Dims ) = rand (GLOBAL_RNG , _make_cont (t, dims))),
100- :(rand (rng:: AbstractRNG , $ Cont, dims:: Integer... ) = rand (rng, _make_cont (t, Dims (dims)))),
101- :(rand ( $ Cont, dims:: Integer... ) = rand (GLOBAL_RNG , _make_cont (t, Dims (dims)))),
102-
103- :(rand (rng:: AbstractRNG , X, $ Cont, dims:: Dims ) = rand (rng, _make_cont (t, X, dims))),
104- :(rand ( X, $ Cont, dims:: Dims ) = rand (GLOBAL_RNG , _make_cont (t, X, dims))),
105- :(rand (rng:: AbstractRNG , X, $ Cont, dims:: Integer... ) = rand (rng, _make_cont (t, X, Dims (dims)))),
106- :(rand ( X, $ Cont, dims:: Integer... ) = rand (GLOBAL_RNG , _make_cont (t, X, Dims (dims)))),
107-
108- :(rand (rng:: AbstractRNG , :: Type{X} , $ Cont, dims:: Dims ) where {X} = rand (rng, _make_cont (t, X, dims))),
109- :(rand ( :: Type{X} , $ Cont, dims:: Dims ) where {X} = rand (GLOBAL_RNG , _make_cont (t, X, dims))),
110- :(rand (rng:: AbstractRNG , :: Type{X} , $ Cont, dims:: Integer... ) where {X} = rand (rng, _make_cont (t, X, Dims (dims)))),
111- :(rand ( :: Type{X} , $ Cont, dims:: Integer... ) where {X} = rand (GLOBAL_RNG , _make_cont (t, X, Dims (dims)))),
98+ [ :(rand (rng:: AbstractRNG , $ Cont, dims:: Dims ) = rand (rng, _make_cont (t, dims))),
99+ :(rand ( $ Cont, dims:: Dims ) = rand (default_rng () , _make_cont (t, dims))),
100+ :(rand (rng:: AbstractRNG , $ Cont, dims:: Integer... ) = rand (rng, _make_cont (t, Dims (dims)))),
101+ :(rand ( $ Cont, dims:: Integer... ) = rand (default_rng () , _make_cont (t, Dims (dims)))),
102+
103+ :(rand (rng:: AbstractRNG , X, $ Cont, dims:: Dims ) = rand (rng, _make_cont (t, X, dims))),
104+ :(rand ( X, $ Cont, dims:: Dims ) = rand (default_rng () , _make_cont (t, X, dims))),
105+ :(rand (rng:: AbstractRNG , X, $ Cont, dims:: Integer... ) = rand (rng, _make_cont (t, X, Dims (dims)))),
106+ :(rand ( X, $ Cont, dims:: Integer... ) = rand (default_rng () , _make_cont (t, X, Dims (dims)))),
107+
108+ :(rand (rng:: AbstractRNG , :: Type{X} , $ Cont, dims:: Dims ) where {X} = rand (rng, _make_cont (t, X, dims))),
109+ :(rand ( :: Type{X} , $ Cont, dims:: Dims ) where {X} = rand (default_rng () , _make_cont (t, X, dims))),
110+ :(rand (rng:: AbstractRNG , :: Type{X} , $ Cont, dims:: Integer... ) where {X} = rand (rng, _make_cont (t, X, Dims (dims)))),
111+ :(rand ( :: Type{X} , $ Cont, dims:: Integer... ) where {X} = rand (default_rng () , _make_cont (t, X, Dims (dims)))),
112112 ]
113113 esc (Expr (:block , definitions... ))
114114end
@@ -133,9 +133,9 @@ function _rand!(rng::AbstractRNG, A::SetDict, n::Integer, sp::Sampler)
133133 A
134134end
135135
136- rand! ( A:: SetDict , X= default_sampling (A)) = rand! (GLOBAL_RNG , A, X)
136+ rand! ( A:: SetDict , X= default_sampling (A)) = rand! (default_rng () , A, X)
137137rand! (rng:: AbstractRNG , A:: SetDict , X= default_sampling (A)) = _rand! (rng, A, length (A), sampler (rng, X))
138- rand! ( A:: SetDict , :: Type{X} ) where {X} = rand! (GLOBAL_RNG , A, X)
138+ rand! ( A:: SetDict , :: Type{X} ) where {X} = rand! (default_rng () , A, X)
139139rand! (rng:: AbstractRNG , A:: SetDict , :: Type{X} ) where {X} = rand! (rng, A, Sampler (rng, X))
140140
141141@make_container (T:: Type{<:SetDict} , n:: Integer )
0 commit comments