Skip to content

Commit

Permalink
a lot more depwarn fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisRackauckas committed Jul 20, 2018
1 parent e7b3d0e commit c763700
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 20 deletions.
1 change: 1 addition & 0 deletions test/adaptive/sde_linearadaptive_tests.jl
Expand Up @@ -10,6 +10,7 @@ add_probs[2] = prob_sde_additivesystem


for i in 1:2
global sol,sol2,err1
bigprob = SDEProblem(probs[i].f,probs[i].g,big.(probs[i].u0),(big.(probs[i].tspan[1]),big.(probs[i].tspan[2])),noise=probs[i].noise)
add_bigprob = SDEProblem(add_probs[i].f,add_probs[i].g,big.(add_probs[i].u0),(big.(add_probs[i].tspan[1]),big.(add_probs[i].tspan[2])),noise=add_probs[i].noise)
## SRIW1
Expand Down
2 changes: 1 addition & 1 deletion test/commutative_tests.jl
Expand Up @@ -11,7 +11,7 @@ A = full(Strang(2))
B = Diagonal([σ_const for i in 1:2])

function f_commute(du,u,p,t)
A_mul_B!(du,A,u)
mul!(du,A,u)
du .+= 1.01u
end
function (::typeof(f_commute))(::Type{Val{:analytic}},u0,p,t,W)
Expand Down
6 changes: 3 additions & 3 deletions test/iif_methods.jl
Expand Up @@ -50,12 +50,12 @@ B = [σ_const 0
0 σ_const]

function f(du,u,p,t)
A_mul_B!(du,A,u)
mul!(du,A,u)
du .+= 1.01u
end
function σ(du,u,p,t)
A_mul_B!(@view(du[:,1]),B,u)
A_mul_B!(@view(du[:,2]),B,u)
mul!(@view(du[:,1]),B,u)
mul!(@view(du[:,2]),B,u)
end

function (::typeof(f))(::Type{Val{:analytic}},u0,p,t,W)
Expand Down
8 changes: 4 additions & 4 deletions test/mass_matrix_tests.jl
Expand Up @@ -7,16 +7,16 @@ const mm_b = mm_A*ones(3)
function mm_f(du,u,p,t)
mul!(du,mm_A,u)
tmp = t*mm_b
du .+= tmp
@. du += tmp
end
function mm_analytic(u0,p,t,W)
@. 2ones(3)*exp(t) - t - 1
end
function mm_g(du,u,p,t)
du .= u + t
@. du = u + t
end
function g!(du,u,p,t)
du .= 0.0
@. du = 0.0
end

prob2 = SDEProblem(SDEFunction(mm_g,g!,analytic=mm_analytic),g!,ones(3),(0.0,1.0))
Expand Down Expand Up @@ -44,7 +44,7 @@ sol2 = solve(prob2, ImplicitEM(symplectic=true), dt = 0.01, adaptive = false)
@test norm(sol .- sol2) 0 atol=1e-11

function mm_f2(du,u,p,t)
A_mul_B!(du,mm_A,u)
mul!(du,mm_A,u)
end
function no_mm_f2(du,u,p,t)
du .= u
Expand Down
12 changes: 6 additions & 6 deletions test/multivariate_geometric.jl
Expand Up @@ -7,11 +7,11 @@ B = [1/5 1/100
1/100 1/5]

function f(du,u,p,t)
A_mul_B!(du,A,u)
mul!(du,A,u)
end
function σ(du,u,p,t)
A_mul_B!(@view(du[:,1]),B,u)
A_mul_B!(@view(du[:,2]),B,u)
mul!(@view(du[:,1]),B,u)
mul!(@view(du[:,2]),B,u)
end

function (::typeof(f))(::Type{Val{:analytic}},u0,p,t,W)
Expand Down Expand Up @@ -39,12 +39,12 @@ B = [1/5 1/100
1/100 1/5]

function f(du,u,p,t)
A_mul_B!(du,A,u)
mul!(du,A,u)
du .+= 1.01u
end
function σ(du,u,p,t)
A_mul_B!(@view(du[:,1]),B,u)
A_mul_B!(@view(du[:,2]),B,u)
mul!(@view(du[:,1]),B,u)
mul!(@view(du[:,2]),B,u)
end

function (::typeof(f))(::Type{Val{:analytic}},u0,p,t,W)
Expand Down
2 changes: 1 addition & 1 deletion test/nondiagonal_tests.jl
Expand Up @@ -14,7 +14,7 @@ function f_nondiag(u,p,t)
end

function f_nondiag(du,u,p,t)
A_mul_B!(du,A,u)
mul!(du,A,u)
du .+= 1.01u
end

Expand Down
8 changes: 4 additions & 4 deletions test/static_array_tests.jl
Expand Up @@ -3,14 +3,14 @@ using DiffEqBase, StochasticDiffEq

f(du,u,p,t) = (du .= u)

u0 = zeros(MVector{2,Float64}, 2) + 1
u0[1] = ones(MVector{2,Float64}) + 1
u0 = zeros(MVector{2,Float64}, 2) .+ 1
u0[1] = ones(MVector{2,Float64}) .+ 1
ode = SDEProblem(f,f, u0, (0.,1.))
sol = solve(ode, EM(), dt=1.e-2)
sol = solve(ode, SRIW1())

u0 = zeros(SVector{2,Float64}, 2) + 1
u0[1] = ones(SVector{2,Float64}) + 1
u0 = zeros(SVector{2,Float64}, 2) .+ 1
u0[1] = ones(SVector{2,Float64}) .+ 1
ode = SDEProblem(f, f, u0, (0.,1.))
sol = solve(ode, EM(), dt=1.e-2)
sol = solve(ode, SRIW1(), dt=1.e-2)
Expand Down
6 changes: 5 additions & 1 deletion test/tolerances_tests.jl
Expand Up @@ -18,7 +18,7 @@ probs = [prob_sde_2Dlinear,
SDEProblem(f,σ,prob_sde_2Dlinear.u0,prob_sde_2Dlinear.tspan)]
=#

let probs = [prob_sde_2Dlinear], algs = [SRI(),SRIW1(),SRA1(),SRA(),RKMil()]
function tolerance_testing(probs,algs)
for alg in algs, prob in probs
dt = typeof(alg)<:StochasticDiffEqAdaptiveAlgorithm ? 0.0 : 0.1
srand(100)
Expand All @@ -37,3 +37,7 @@ let probs = [prob_sde_2Dlinear], algs = [SRI(),SRIW1(),SRA1(),SRA(),RKMil()]
@test sol.t == sol2.t && sol.u == sol2.u
end
end

probs = [prob_sde_2Dlinear]
algs = [SRI(),SRIW1(),SRA1(),SRA(),RKMil()]
tolerance_testing(probs,algs)

0 comments on commit c763700

Please sign in to comment.