@@ -11,7 +11,7 @@ function rand!(rng::AbstractRNG, B::BitArray, ::SamplerType{Bool})
11
11
end
12
12
13
13
"""
14
- bitrand([rng=GLOBAL_RNG ], [dims...])
14
+ bitrand([rng=default_rng() ], [dims...])
15
15
16
16
Generate a `BitArray` of random boolean values.
17
17
@@ -43,7 +43,7 @@ bitrand(dims::Integer...) = rand!(BitArray(undef, convert(Dims, dims)))
43
43
# # randstring (often useful for temporary filenames/dirnames)
44
44
45
45
"""
46
- randstring([rng=GLOBAL_RNG ], [chars], [len=8])
46
+ randstring([rng=default_rng() ], [chars], [len=8])
47
47
48
48
Create a random string of length `len`, consisting of characters from
49
49
`chars`, which defaults to the set of upper- and lower-case letters
@@ -126,7 +126,7 @@ function randsubseq!(r::AbstractRNG, S::AbstractArray, A::AbstractArray, p::Real
126
126
end
127
127
128
128
"""
129
- randsubseq!([rng=GLOBAL_RNG ,] S, A, p)
129
+ randsubseq!([rng=default_rng() ,] S, A, p)
130
130
131
131
Like [`randsubseq`](@ref), but the results are stored in `S`
132
132
(which is resized as needed).
@@ -154,7 +154,7 @@ randsubseq(r::AbstractRNG, A::AbstractArray{T}, p::Real) where {T} =
154
154
randsubseq! (r, T[], A, p)
155
155
156
156
"""
157
- randsubseq([rng=GLOBAL_RNG ,] A, p) -> Vector
157
+ randsubseq([rng=default_rng() ,] A, p) -> Vector
158
158
159
159
Return a vector consisting of a random subsequence of the given array `A`, where each
160
160
element of `A` is included (in order) with independent probability `p`. (Complexity is
@@ -182,7 +182,7 @@ ltm52(n::Int, mask::Int=nextpow(2, n)-1) = LessThan(n-1, Masked(mask, UInt52Raw(
182
182
# # shuffle & shuffle!
183
183
184
184
"""
185
- shuffle!([rng=GLOBAL_RNG ,] v::AbstractArray)
185
+ shuffle!([rng=default_rng() ,] v::AbstractArray)
186
186
187
187
In-place version of [`shuffle`](@ref): randomly permute `v` in-place,
188
188
optionally supplying the random-number generator `rng`.
228
228
shuffle! (a:: AbstractArray ) = shuffle! (default_rng (), a)
229
229
230
230
"""
231
- shuffle([rng=GLOBAL_RNG ,] v::AbstractArray)
231
+ shuffle([rng=default_rng() ,] v::AbstractArray)
232
232
233
233
Return a randomly permuted copy of `v`. The optional `rng` argument specifies a random
234
234
number generator (see [Random Numbers](@ref)).
@@ -260,7 +260,7 @@ shuffle(a::AbstractArray) = shuffle(default_rng(), a)
260
260
# # randperm & randperm!
261
261
262
262
"""
263
- randperm([rng=GLOBAL_RNG ,] n::Integer)
263
+ randperm([rng=default_rng() ,] n::Integer)
264
264
265
265
Construct a random permutation of length `n`. The optional `rng`
266
266
argument specifies a random number generator (see [Random
@@ -288,7 +288,7 @@ randperm(r::AbstractRNG, n::T) where {T <: Integer} = randperm!(r, Vector{T}(und
288
288
randperm (n:: Integer ) = randperm (default_rng (), n)
289
289
290
290
"""
291
- randperm!([rng=GLOBAL_RNG ,] A::Array{<:Integer})
291
+ randperm!([rng=default_rng() ,] A::Array{<:Integer})
292
292
293
293
Construct in `A` a random permutation of length `length(A)`. The
294
294
optional `rng` argument specifies a random number generator (see
@@ -328,7 +328,7 @@ randperm!(a::Array{<:Integer}) = randperm!(default_rng(), a)
328
328
# # randcycle & randcycle!
329
329
330
330
"""
331
- randcycle([rng=GLOBAL_RNG ,] n::Integer)
331
+ randcycle([rng=default_rng() ,] n::Integer)
332
332
333
333
Construct a random cyclic permutation of length `n`. The optional `rng`
334
334
argument specifies a random number generator, see [Random Numbers](@ref).
@@ -354,7 +354,7 @@ randcycle(r::AbstractRNG, n::T) where {T <: Integer} = randcycle!(r, Vector{T}(u
354
354
randcycle (n:: Integer ) = randcycle (default_rng (), n)
355
355
356
356
"""
357
- randcycle!([rng=GLOBAL_RNG ,] A::Array{<:Integer})
357
+ randcycle!([rng=default_rng() ,] A::Array{<:Integer})
358
358
359
359
Construct in `A` a random cyclic permutation of length `length(A)`.
360
360
The optional `rng` argument specifies a random number generator, see
0 commit comments