Skip to content

Commit

Permalink
Merged branch ind into master
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisRackauckas committed Jan 21, 2017
2 parents 65b9fb6 + 47999f5 commit 483c810
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/integrators/integrator_utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ end
if !(uType <: AbstractArray)
dttmp = 0.0; ΔW = 0.0; ΔZ = 0.0
else
dttmp = 0.0; ΔW = zeros(u); ΔZ = zeros(u)
dttmp = 0.0; ΔW = zeros(size(u)...); ΔZ = zeros(size(u)...)
end
while !isempty(S₁)
L₁,L₂,L₃ = pop!(S₁)
Expand Down Expand Up @@ -210,7 +210,7 @@ end
if !(uType <: AbstractArray)
dttmp = 0.0; ΔWtmp = 0.0; ΔZtmp = 0.0
else
dttmp = 0.0; ΔWtmp = zeros(u); ΔZtmp = zeros(u)
dttmp = 0.0; ΔWtmp = zeros(size(u)...); ΔZtmp = zeros(size(u)...)
end
if length(S₂) > max_stack_size2
max_stack_size2= length(S₂)
Expand Down
11 changes: 6 additions & 5 deletions src/solve.jl
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,13 @@ function solve{uType,tType,isinplace,NoiseClass,F,F2,F3,algType<:AbstractSDEAlgo

if !(uType <: AbstractArray)
rands = ChunkedArray(noise.noise_func)
randType = typeof(u/u) # Strip units and type info
else
rands = ChunkedArray(noise.noise_func,map((x)->x/x,u)) # Strip units
rand_prototype = similar(map((x)->x/x,u),indices(u))
rands = ChunkedArray(noise.noise_func,rand_prototype) # Strip units
randType = typeof(rand_prototype) # Strip units and type info
end

randType = typeof(map((x)->x/x,u)) # Strip units

if uType <: AbstractArray
uEltypeNoUnits = eltype(u./u)
else
Expand All @@ -109,8 +110,8 @@ function solve{uType,tType,isinplace,NoiseClass,F,F2,F3,algType<:AbstractSDEAlgo
Z = 0.0
push!(Ws,W)
else
W = zeros(u0)
Z = zeros(u0)
W = zeros(rand_prototype)
Z = zeros(rand_prototype)
push!(Ws,copy(W))
end
sqdt = sqrt(dt)
Expand Down

0 comments on commit 483c810

Please sign in to comment.