Skip to content

Commit 3ef306b

Browse files
maleadtjrevels
authored andcommitted
Use Compat.Random for 0.7 compatibility.
1 parent 8f9e9b3 commit 3ef306b

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

REQUIRE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
julia 0.6.0
2-
Compat 0.45.0
2+
Compat 0.47.0
33
StaticArrays 0.5.0
44
DiffResults 0.0.1
55
DiffRules 0.0.3

src/ForwardDiff.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ using DiffRules, DiffResults
66
using DiffResults: DiffResult, MutableDiffResult, ImmutableDiffResult
77
using StaticArrays
88
using Compat
9+
using Compat.Random
910

1011
import NaNMath
1112
import SpecialFunctions

src/partials.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@ Base.IndexStyle(::Type{<:Partials}) = IndexLinear()
4040
@inline Base.one(partials::Partials) = one(typeof(partials))
4141
@inline Base.one(::Type{Partials{N,V}}) where {N,V} = Partials{N,V}(one_tuple(NTuple{N,V}))
4242

43-
@inline Base.rand(partials::Partials) = rand(typeof(partials))
44-
@inline Base.rand(::Type{Partials{N,V}}) where {N,V} = Partials{N,V}(rand_tuple(NTuple{N,V}))
45-
@inline Base.rand(rng::AbstractRNG, partials::Partials) = rand(rng, typeof(partials))
46-
@inline Base.rand(rng::AbstractRNG, ::Type{Partials{N,V}}) where {N,V} = Partials{N,V}(rand_tuple(rng, NTuple{N,V}))
43+
@inline Random.rand(partials::Partials) = rand(typeof(partials))
44+
@inline Random.rand(::Type{Partials{N,V}}) where {N,V} = Partials{N,V}(rand_tuple(NTuple{N,V}))
45+
@inline Random.rand(rng::AbstractRNG, partials::Partials) = rand(rng, typeof(partials))
46+
@inline Random.rand(rng::AbstractRNG, ::Type{Partials{N,V}}) where {N,V} = Partials{N,V}(rand_tuple(rng, NTuple{N,V}))
4747

4848
Base.isequal(a::Partials{N}, b::Partials{N}) where {N} = isequal(a.values, b.values)
4949
Base.:(==)(a::Partials{N}, b::Partials{N}) where {N} = a.values == b.values

0 commit comments

Comments
 (0)