Skip to content

Commit

Permalink
fix @def and depwarns
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisRackauckas committed Dec 21, 2016
1 parent b388d2b commit 87df0c7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/StochasticDiffEq.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module StochasticDiffEq

macro def(name, definition)
quote
macro $name()
macro $(esc(name))()
esc($(Expr(:quote, definition)))
end
end
Expand Down
9 changes: 4 additions & 5 deletions src/solve.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@inline ODE_DEFAULT_NORM(u) = sqrt(sumabs2(u) / length(u))
@inline ODE_DEFAULT_NORM(u) = sqrt(sum(abs2,u) / length(u))
@inline ODE_DEFAULT_PROG_MESSAGE(dt,t,u) = "dt="*string(dt)*"\nt="*string(t)*"\nmax u="*string(maximum(abs.(u)))
@inline ODE_DEFAULT_UNSTABLE_CHECK(dt,t,u) = any(isnan,u)

Expand Down Expand Up @@ -139,8 +139,7 @@ function sde_determine_initdt(u0,t,abstol,reltol,internalnorm,f,g,order)
f(t,u0,f₀)
g(t,u0,g₀); g₀.*=3
end

d₁ = norm(max(abs.(f₀.+g₀),abs.(f₀-g₀))./(abstol+u0*reltol),2)
d₁ = norm(max.(abs.(f₀.+g₀),abs.(f₀-g₀))./(abstol+u0*reltol),2)
if d₀ < 1e-5 || d₁ < 1e-5
dt₀ = 1e-6
else
Expand All @@ -156,8 +155,8 @@ function sde_determine_initdt(u0,t,abstol,reltol,internalnorm,f,g,order)
f(t,u0,f₁)
g(t,u0,g₁); g₁.*=3
end
ΔgMax = max(abs.(g₀-g₁),abs.(g₀+g₁))
d₂ = norm(max(abs.(f₁.-f₀.+ΔgMax),abs.(f₁.-f₀.-ΔgMax))./(abstol+u0*reltol),2)/dt₀
ΔgMax = max.(abs.(g₀-g₁),abs.(g₀+g₁))
d₂ = norm(max.(abs.(f₁.-f₀.+ΔgMax),abs.(f₁.-f₀.-ΔgMax))./(abstol+u0*reltol),2)/dt₀
if max(d₁,d₂)<=1e-15
dt₁ = max(1e-6,dt₀*1e-3)
else
Expand Down
2 changes: 1 addition & 1 deletion test/sde/sde_linear_tests.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using StochasticDiffEq, DiffEqDevTools
using StochasticDiffEq, DiffEqDevTools, DiffEqProblemLibrary
srand(100)
prob = prob_sde_linear

Expand Down

0 comments on commit 87df0c7

Please sign in to comment.