Skip to content

Commit

Permalink
fix ambiguities in wiener_randn!
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisRackauckas committed Jan 25, 2019
1 parent 9bd14d9 commit f11df87
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/wiener.jl
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
const one_over_sqrt2 = 1/sqrt(2)
@inline wiener_randn(rng,::Type{T}) where T = randn(rng,T)
@inline wiener_randn(x,y) = randn(x,y)
@inline wiener_randn!(rng,rand_vec::Array) = randn!(rng,rand_vec)
@inline wiener_randn(rng::AbstractRNG,::Type{T}) where T = randn(rng,T)
@inline wiener_randn(rng::AbstractRNG,y) = randn(rng,y)
@inline wiener_randn!(rng::AbstractRNG,rand_vec::Array) = randn!(rng,rand_vec)

# TODO: This needs an overload for GPUs
@inline wiener_randn!(rng,rand_vec) = rand_vec .= Base.Broadcast.Broadcasted(randn,())
@inline wiener_randn!(rng::AbstractRNG,rand_vec) = rand_vec .= Base.Broadcast.Broadcasted(randn,())
@inline wiener_randn(y::AbstractRNG,::Type{Complex{T}}) where T = one_over_sqrt2*(randn(y,T)+im*randn(y,T))

@inline function wiener_randn!(y::AbstractRNG,x::AbstractArray{<:Complex{T}}) where T<:Number
Expand Down

0 comments on commit f11df87

Please sign in to comment.