Skip to content

Commit

Permalink
Merge branch 'test'
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisRackauckas committed Nov 17, 2017
2 parents ad49cdc + 073d6e0 commit 32790b5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/alg_utils.jl
Expand Up @@ -32,7 +32,7 @@ alg_interpretation(alg::StochasticDiffEqAlgorithm) = :Ito
alg_interpretation(alg::EulerHeun) = :Stratonovich
alg_interpretation(alg::RKMil{interpretation}) where {interpretation} = interpretation
alg_interpretation(alg::RKMilCommute{interpretation}) where {interpretation} = interpretation
alg_interpretation(alg::ImplicitRKMil{CS,AD,F,K,T,T2,Controller,interpretation}) where {CS,AD,F,K,T,T2,Controller,interpretation} = interpretation
alg_interpretation(alg::ImplicitRKMil{CS,AD,F,S,K,T,T2,Controller,interpretation}) where {CS,AD,F,S,K,T,T2,Controller,interpretation} = interpretation

alg_compatible(prob,alg::Union{StochasticDiffEqAlgorithm,StochasticDiffEqRODEAlgorithm}) = true

Expand Down
12 changes: 6 additions & 6 deletions src/algorithms.jl
Expand Up @@ -60,7 +60,7 @@ Base.@pure IIF1Mil(;nlsolve=NLSOLVEJL_SETUP()) = IIF1Mil{typeof(nlsolve)}(nlsolv

# SDIRK

struct ImplicitEM{CS,AD,S,F,K,T,T2,Controller} <: StochasticDiffEqNewtonAlgorithm{CS,AD,Controller}
struct ImplicitEM{CS,AD,F,S,K,T,T2,Controller} <: StochasticDiffEqNewtonAlgorithm{CS,AD,Controller}
linsolve::F
diff_type::S
κ::K
Expand All @@ -78,15 +78,15 @@ Base.@pure ImplicitEM(;chunk_size=0,autodiff=true,diff_type=Val{:central},
theta = 1/2,symplectic=false,
max_newton_iter=7,new_jac_conv_bound = 1e-3,
controller = :Predictive) =
ImplicitEM{chunk_size,autodiff,typeof(diff_type),typeof(linsolve),
ImplicitEM{chunk_size,autodiff,typeof(linsolve),typeof(diff_type),
typeof(κ),typeof(tol),typeof(new_jac_conv_bound),controller}(
linsolve,diff_type,κ,tol,
symplectic ? 1/2 : theta,
extrapolant,
min_newton_iter,
max_newton_iter,new_jac_conv_bound,symplectic)

struct ImplicitEulerHeun{CS,AD,S,F,K,T,T2,Controller} <: StochasticDiffEqNewtonAlgorithm{CS,AD,Controller}
struct ImplicitEulerHeun{CS,AD,F,S,K,T,T2,Controller} <: StochasticDiffEqNewtonAlgorithm{CS,AD,Controller}
linsolve::F
diff_type::S
κ::K
Expand All @@ -104,14 +104,14 @@ Base.@pure ImplicitEulerHeun(;chunk_size=0,autodiff=true,diff_type=Val{:central}
theta = 1/2,symplectic = false,
max_newton_iter=7,new_jac_conv_bound = 1e-3,
controller = :Predictive) =
ImplicitEulerHeun{chunk_size,autodiff,typeof(diff_type),typeof(linsolve),
ImplicitEulerHeun{chunk_size,autodiff,typeof(linsolve),typeof(diff_type),
typeof(κ),typeof(tol),typeof(new_jac_conv_bound),controller}(
linsolve,diff_type,κ,tol,
symplectic ? 1/2 : theta,
extrapolant,min_newton_iter,
max_newton_iter,new_jac_conv_bound,symplectic)

struct ImplicitRKMil{CS,AD,S,F,K,T,T2,Controller,interpretation} <: StochasticDiffEqNewtonAlgorithm{CS,AD,Controller}
struct ImplicitRKMil{CS,AD,F,S,K,T,T2,Controller,interpretation} <: StochasticDiffEqNewtonAlgorithm{CS,AD,Controller}
linsolve::F
diff_type::S
κ::K
Expand All @@ -129,7 +129,7 @@ Base.@pure ImplicitRKMil(;chunk_size=0,autodiff=true,diff_type=Val{:central},
theta = 1/2,symplectic = false,
max_newton_iter=7,new_jac_conv_bound = 1e-3,
controller = :Predictive,interpretation=:Ito) =
ImplicitRKMil{chunk_size,autodiff,typeof(diff_type),typeof(linsolve),
ImplicitRKMil{chunk_size,autodiff,typeof(linsolve),typeof(diff_type),
typeof(κ),typeof(tol),typeof(new_jac_conv_bound),
controller,interpretation}(
linsolve,diff_type,κ,tol,
Expand Down
2 changes: 1 addition & 1 deletion test/sde/sde_twodimlinear_tests.jl
Expand Up @@ -42,7 +42,7 @@ sim = test_convergence(dts,prob,ImplicitRKMil(),numMonte=100)
sim = test_convergence(dts,prob,ImplicitRKMil(theta=1),numMonte=100)
@test abs(sim.𝒪est[:l2]-1) < 0.1

sim = test_convergence(dts,prob,ImplicitRKMil(theta=1,autodiff=false),numMonte=100)
sim = test_convergence(dts,prob,ImplicitRKMil(theta=1,autodiff=false),numMonte=200)
@test abs(sim.𝒪est[:l2]-1) < 0.1

sim = test_convergence(dts,prob,ImplicitRKMil(symplectic=true),numMonte=100)
Expand Down

0 comments on commit 32790b5

Please sign in to comment.