Skip to content

Commit

Permalink
depwarn fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisRackauckas committed Jul 20, 2018
1 parent dc0114c commit c266a53
Show file tree
Hide file tree
Showing 13 changed files with 242 additions and 239 deletions.
13 changes: 8 additions & 5 deletions src/algorithms.jl
Expand Up @@ -67,13 +67,16 @@ PCEuler(ggprime; theta=1/2, eta=1/2) = PCEuler(theta,eta,ggprime)

# Rossler

@with_kw struct SRA{TabType} <: StochasticDiffEqAdaptiveAlgorithm
tableau::TabType = constructSRA1()
struct SRA{TabType} <: StochasticDiffEqAdaptiveAlgorithm
tableau::TabType
end
@with_kw struct SRI{TabType} <: StochasticDiffEqAdaptiveAlgorithm
tableau::TabType = constructSRIW1()
error_terms = 4
SRA(;tableau=constructSRA1()) = SRA(tableau)

struct SRI{TabType} <: StochasticDiffEqAdaptiveAlgorithm
tableau::TabType
error_terms::Int
end
SRI(;tableau=constructSRIW1(),error_terms=4) = SRI(tableau,error_terms)

struct SRIW1 <: StochasticDiffEqAdaptiveAlgorithm end
struct SRIW2 <: StochasticDiffEqAdaptiveAlgorithm end
Expand Down
36 changes: 18 additions & 18 deletions src/caches/basic_method_caches.jl
Expand Up @@ -14,12 +14,12 @@ du_cache(c::EMCache) = (c.rtmp1,c.rtmp2)
alg_cache(alg::EM,prob,u,ΔW,ΔZ,p,rate_prototype,noise_rate_prototype,uEltypeNoUnits,uBottomEltype,tTypeNoUnits,uprev,f,t,::Type{Val{false}}) = EMConstantCache()

function alg_cache(alg::EM,prob,u,ΔW,ΔZ,p,rate_prototype,noise_rate_prototype,uEltypeNoUnits,uBottomEltype,tTypeNoUnits,uprev,f,t,::Type{Val{true}})
tmp = zeros(u); rtmp1 = zeros(rate_prototype);
rtmp2 = zeros(noise_rate_prototype)
tmp = zero(u); rtmp1 = zero(rate_prototype);
rtmp2 = zero(noise_rate_prototype)
if is_diagonal_noise(prob)
rtmp3 = rtmp2
else
rtmp3 = zeros(rate_prototype)
rtmp3 = zero(rate_prototype)
end
EMCache(u,uprev,tmp,rtmp1,rtmp2,rtmp3)
end
Expand All @@ -40,12 +40,12 @@ du_cache(c::SplitEMCache) = (c.rtmp1,c.rtmp2)
alg_cache(alg::SplitEM,prob,u,ΔW,ΔZ,p,rate_prototype,noise_rate_prototype,uEltypeNoUnits,uBottomEltype,tTypeNoUnits,uprev,f,t,::Type{Val{false}}) = SplitEMConstantCache()

function alg_cache(alg::SplitEM,prob,u,ΔW,ΔZ,p,rate_prototype,noise_rate_prototype,uEltypeNoUnits,uBottomEltype,tTypeNoUnits,uprev,f,t,::Type{Val{true}})
tmp = zeros(u); rtmp1 = zeros(rate_prototype);
rtmp2 = zeros(noise_rate_prototype)
tmp = zero(u); rtmp1 = zero(rate_prototype);
rtmp2 = zero(noise_rate_prototype)
if is_diagonal_noise(prob)
rtmp3 = rtmp2
else
rtmp3 = zeros(rate_prototype)
rtmp3 = zero(rate_prototype)
end
SplitEMCache(u,uprev,tmp,rtmp1,rtmp2,rtmp3)
end
Expand All @@ -68,9 +68,9 @@ du_cache(c::EulerHeunCache) = (c.rtmp1,c.rtmp2,c.rtmp3,c.rtmp4)
alg_cache(alg::EulerHeun,prob,u,ΔW,ΔZ,p,rate_prototype,noise_rate_prototype,uEltypeNoUnits,uBottomEltype,tTypeNoUnits,uprev,f,t,::Type{Val{false}}) = EulerHeunConstantCache()

function alg_cache(alg::EulerHeun,prob,u,ΔW,ΔZ,p,rate_prototype,noise_rate_prototype,uEltypeNoUnits,uBottomEltype,tTypeNoUnits,uprev,f,t,::Type{Val{true}})
tmp = zeros(u); ftmp1 = zeros(rate_prototype); ftmp2 = zeros(rate_prototype)
nrtmp = zeros(rate_prototype)
gtmp1 = zeros(noise_rate_prototype); gtmp2 = zeros(noise_rate_prototype)
tmp = zero(u); ftmp1 = zero(rate_prototype); ftmp2 = zero(rate_prototype)
nrtmp = zero(rate_prototype)
gtmp1 = zero(noise_rate_prototype); gtmp2 = zero(noise_rate_prototype)
EulerHeunCache(u,uprev,tmp,ftmp1,ftmp2,nrtmp,gtmp1,gtmp2)
end

Expand All @@ -88,7 +88,7 @@ du_cache(c::RandomEMCache) = (c.rtmp1,c.rtmp2)
alg_cache(alg::RandomEM,prob,u,ΔW,ΔZ,p,rate_prototype,noise_rate_prototype,uEltypeNoUnits,uBottomEltype,tTypeNoUnits,uprev,f,t,::Type{Val{false}}) = RandomEMConstantCache()

function alg_cache(alg::RandomEM,prob,u,ΔW,ΔZ,p,rate_prototype,noise_rate_prototype,uEltypeNoUnits,uBottomEltype,tTypeNoUnits,uprev,f,t,::Type{Val{true}})
tmp = zeros(u); rtmp = zeros(rate_prototype)
tmp = zero(u); rtmp = zero(rate_prototype)
RandomEMCache(u,uprev,tmp,rtmp)
end

Expand All @@ -109,8 +109,8 @@ du_cache(c::RKMilCache) = (c.du1,c.du2,c.K,c.L)
alg_cache(alg::RKMil,prob,u,ΔW,ΔZ,p,rate_prototype,noise_rate_prototype,uEltypeNoUnits,uBottomEltype,tTypeNoUnits,uprev,f,t,::Type{Val{false}}) = RKMilConstantCache()

function alg_cache(alg::RKMil,prob,u,ΔW,ΔZ,p,rate_prototype,noise_rate_prototype,uEltypeNoUnits,uBottomEltype,tTypeNoUnits,uprev,f,t,::Type{Val{true}})
du1 = zeros(rate_prototype); du2 = zeros(rate_prototype)
K = zeros(rate_prototype); tmp = zeros(u); L = zeros(rate_prototype)
du1 = zero(rate_prototype); du2 = zero(rate_prototype)
K = zero(rate_prototype); tmp = zero(u); L = zero(rate_prototype)
RKMilCache(u,uprev,du1,du2,K,tmp,L)
end

Expand All @@ -137,11 +137,11 @@ du_cache(c::RKMilCommuteCache) = (c.du1,c.du2,c.K,c.L)
alg_cache(alg::RKMilCommute,prob,u,ΔW,ΔZ,p,rate_prototype,noise_rate_prototype,uEltypeNoUnits,uBottomEltype,tTypeNoUnits,uprev,f,t,::Type{Val{false}}) = RKMilCommuteConstantCache()

function alg_cache(alg::RKMilCommute,prob,u,ΔW,ΔZ,p,rate_prototype,noise_rate_prototype,uEltypeNoUnits,uBottomEltype,tTypeNoUnits,uprev,f,t,::Type{Val{true}})
du1 = zeros(rate_prototype); du2 = zeros(rate_prototype)
K = zeros(rate_prototype); gtmp = zeros(noise_rate_prototype);
L = zeros(noise_rate_prototype); tmp = zeros(rate_prototype)
I = zeros(length(ΔW),length(ΔW));
Dg = zeros(length(ΔW),length(ΔW)); mil_correction = zeros(rate_prototype)
Kj = zeros(u); Dgj = zeros(noise_rate_prototype)
du1 = zero(rate_prototype); du2 = zero(rate_prototype)
K = zero(rate_prototype); gtmp = zero(noise_rate_prototype);
L = zero(noise_rate_prototype); tmp = zero(rate_prototype)
I = zero(length(ΔW),length(ΔW));
Dg = zero(length(ΔW),length(ΔW)); mil_correction = zero(rate_prototype)
Kj = zero(u); Dgj = zero(noise_rate_prototype)
RKMilCommuteCache(u,uprev,du1,du2,K,gtmp,L,I,Dg,mil_correction,Kj,Dgj,tmp)
end
22 changes: 11 additions & 11 deletions src/caches/iif_caches.jl
Expand Up @@ -34,18 +34,18 @@ end

function alg_cache(alg::IIF1M,prob,u,ΔW,ΔZ,p,rate_prototype,noise_rate_prototype,uEltypeNoUnits,uBottomEltype,tTypeNoUnits,uprev,f,t,::Type{Val{true}})

tmp = similar(u,axes(u)); rtmp1 = zeros(rate_prototype)
tmp = similar(u,axes(u)); rtmp1 = zero(rate_prototype)
dual_cache = DiffCache(u,Val{determine_chunksize(u,get_chunksize(alg.nlsolve))})
uhold = vec(u) # this makes uhold the same values as integrator.u
rhs = RHS_IIF1(f,tmp,t,t,dual_cache,size(u),p)
nl_rhs = alg.nlsolve(Val{:init},rhs,uhold)
noise_tmp = tmp

rtmp2 = zeros(noise_rate_prototype)
rtmp2 = zero(noise_rate_prototype)
if is_diagonal_noise(prob)
rtmp3 = rtmp2
else
rtmp3 = zeros(rate_prototype)
rtmp3 = zero(rate_prototype)
end
IIF1MCache(u,uprev,uhold,dual_cache,tmp,rhs,nl_rhs,rtmp1,rtmp2,rtmp3,noise_tmp)
end
Expand Down Expand Up @@ -85,18 +85,18 @@ end

function alg_cache(alg::IIF2M,prob,u,ΔW,ΔZ,p,rate_prototype,noise_rate_prototype,uEltypeNoUnits,uBottomEltype,tTypeNoUnits,uprev,f,t,::Type{Val{true}})

tmp = similar(u,axes(u)); rtmp1 = zeros(rate_prototype)
tmp = similar(u,axes(u)); rtmp1 = zero(rate_prototype)
dual_cache = DiffCache(u,Val{determine_chunksize(u,get_chunksize(alg.nlsolve))})
uhold = vec(u) # this makes uhold the same values as integrator.u
rhs = RHS_IIF2(f,tmp,t,t,dual_cache,size(u),p)
nl_rhs = alg.nlsolve(Val{:init},rhs,uhold)
noise_tmp = tmp

rtmp2 = zeros(noise_rate_prototype)
rtmp2 = zero(noise_rate_prototype)
if is_diagonal_noise(prob)
rtmp3 = rtmp2
else
rtmp3 = zeros(rate_prototype)
rtmp3 = zero(rate_prototype)
end
IIF2MCache(u,uprev,uhold,dual_cache,tmp,rhs,nl_rhs,rtmp1,rtmp2,rtmp3,noise_tmp)
end
Expand Down Expand Up @@ -136,18 +136,18 @@ function alg_cache(alg::IIF1Mil,prob,u,ΔW,ΔZ,p,rate_prototype,noise_rate_proto
end

function alg_cache(alg::IIF1Mil,prob,u,ΔW,ΔZ,p,rate_prototype,noise_rate_prototype,uEltypeNoUnits,uBottomEltype,tTypeNoUnits,uprev,f,t,::Type{Val{true}})
tmp = similar(u,axes(u)); rtmp1 = zeros(rate_prototype)
tmp = similar(u,axes(u)); rtmp1 = zero(rate_prototype)
dual_cache = DiffCache(u,Val{determine_chunksize(u,get_chunksize(alg.nlsolve))})
uhold = vec(u) # this makes uhold the same values as integrator.u
rhs = RHS_IIF1(f,tmp,t,t,dual_cache,size(u))
nl_rhs = alg.nlsolve(Val{:init},rhs,uhold)
noise_tmp = zeros(noise_rate_prototype)
gtmp = zeros(noise_rate_prototype); gtmp2 = zeros(noise_rate_prototype)
rtmp2 = zeros(noise_rate_prototype)
noise_tmp = zero(noise_rate_prototype)
gtmp = zero(noise_rate_prototype); gtmp2 = zero(noise_rate_prototype)
rtmp2 = zero(noise_rate_prototype)
if is_diagonal_noise(prob)
rtmp3 = rtmp2
else
rtmp3 = zeros(rate_prototype)
rtmp3 = zero(rate_prototype)
end
IIF1MilCache(u,uprev,uhold,dual_cache,tmp,rhs,nl_rhs,rtmp1,rtmp2,rtmp3,noise_tmp,gtmp,gtmp2)
end
34 changes: 17 additions & 17 deletions src/caches/implicit_split_step_caches.jl
Expand Up @@ -28,13 +28,13 @@ du_cache(c::ISSEMCache) = (c.k,c.fsalfirst)

function alg_cache(alg::ISSEM,prob,u,ΔW,ΔZ,p,rate_prototype,noise_rate_prototype,
uEltypeNoUnits,uBottomEltype,tTypeNoUnits,uprev,f,t,::Type{Val{true}})
du1 = zeros(rate_prototype)
du1 = zero(rate_prototype)
J = zeros(uEltypeNoUnits,length(u),length(u)) # uEltype?
W = zeros(J)
z = zeros(u)
dz = zeros(u); tmp = zeros(u); gtmp = zeros(noise_rate_prototype)
fsalfirst = zeros(rate_prototype)
k = zeros(rate_prototype)
W = zero(J)
z = zero(u)
dz = zero(u); tmp = zero(u); gtmp = zero(noise_rate_prototype)
fsalfirst = zero(rate_prototype)
k = zero(rate_prototype)

uf = DiffEqDiffTools.UJacobianWrapper(f,t,p)
linsolve = alg.linsolve(Val{:init},uf,u)
Expand All @@ -57,8 +57,8 @@ function alg_cache(alg::ISSEM,prob,u,ΔW,ΔZ,p,rate_prototype,noise_rate_prototy
gtmp2 = gtmp
dW_cache = nothing
else
gtmp2 = zeros(rate_prototype)
dW_cache = zeros(ΔW)
gtmp2 = zero(rate_prototype)
dW_cache = zero(ΔW)
end

ISSEMCache(u,uprev,du1,fsalfirst,k,z,dz,tmp,gtmp,gtmp2,J,W,jac_config,linsolve,uf,
Expand Down Expand Up @@ -124,13 +124,13 @@ du_cache(c::ISSEulerHeunCache) = (c.k,c.fsalfirst)

function alg_cache(alg::ISSEulerHeun,prob,u,ΔW,ΔZ,p,rate_prototype,noise_rate_prototype,
uEltypeNoUnits,uBottomEltype,tTypeNoUnits,uprev,f,t,::Type{Val{true}})
du1 = zeros(rate_prototype)
du1 = zero(rate_prototype)
J = zeros(uEltypeNoUnits,length(u),length(u)) # uEltype?
W = zeros(J)
z = zeros(u)
dz = zeros(u); tmp = zeros(u); gtmp = zeros(noise_rate_prototype)
fsalfirst = zeros(rate_prototype)
k = zeros(rate_prototype)
W = zero(J)
z = zero(u)
dz = zero(u); tmp = zero(u); gtmp = zero(noise_rate_prototype)
fsalfirst = zero(rate_prototype)
k = zero(rate_prototype)

uf = DiffEqDiffTools.UJacobianWrapper(f,t,p)
linsolve = alg.linsolve(Val{:init},uf,u)
Expand All @@ -149,14 +149,14 @@ function alg_cache(alg::ISSEulerHeun,prob,u,ΔW,ΔZ,p,rate_prototype,noise_rate_
tol = min(0.03,first(reltol)^(0.5))
end

gtmp2 = zeros(rate_prototype)
gtmp2 = zero(rate_prototype)

if is_diagonal_noise(prob)
gtmp3 = gtmp2
dW_cache = nothing
else
gtmp3 = zeros(noise_rate_prototype)
dW_cache = zeros(ΔW)
gtmp3 = zero(noise_rate_prototype)
dW_cache = zero(ΔW)
end

ISSEulerHeunCache(u,uprev,du1,fsalfirst,k,z,dz,tmp,gtmp,gtmp2,gtmp3,
Expand Down
20 changes: 10 additions & 10 deletions src/caches/kencarp_caches.jl
Expand Up @@ -70,20 +70,20 @@ du_cache(c::SKenCarpCache) = (c.k,c.fsalfirst)

function alg_cache(alg::SKenCarp,prob,u,ΔW,ΔZ,p,rate_prototype,noise_rate_prototype,uEltypeNoUnits,uBottomEltype,tTypeNoUnits,uprev,f,t,::Type{Val{true}})

du1 = zeros(rate_prototype)
du1 = zero(rate_prototype)
J = zeros(uEltypeNoUnits,length(u),length(u)) # uEltype?
W = zeros(J)
W = zero(J)
z₁ = similar(u,axes(u)); z₂ = similar(u,axes(u))
z₃ = similar(u,axes(u)); z₄ = similar(u,axes(u))
dz = similar(u,axes(u))
fsalfirst = zeros(rate_prototype)
k = zeros(rate_prototype)
tmp = zeros(u); b = similar(u,axes(u));
atmp = zeros(u,uEltypeNoUnits,axes(u))
fsalfirst = zero(rate_prototype)
k = zero(rate_prototype)
tmp = zero(u); b = similar(u,axes(u));
atmp = zero(u,uEltypeNoUnits,axes(u))

if typeof(f) <: SplitFunction
k1 = zeros(u); k2 = zeros(u)
k3 = zeros(u); k4 = zeros(u)
k1 = zero(u); k2 = zero(u)
k3 = zero(u); k4 = zero(u)
uf = DiffEqDiffTools.UJacobianWrapper(f.f1,t,p)
else
k1 = nothing; k2 = nothing
Expand All @@ -108,10 +108,10 @@ function alg_cache(alg::SKenCarp,prob,u,ΔW,ΔZ,p,rate_prototype,noise_rate_prot
if typeof(ΔW) <: Union{SArray,Number}
chi2 = copy(ΔW)
else
chi2 = zeros(ΔW)
chi2 = zero(ΔW)
end

g1 = zeros(noise_rate_prototype); g4 = zeros(noise_rate_prototype)
g1 = zero(noise_rate_prototype); g4 = zero(noise_rate_prototype)

tab = SKenCarpTableau(real(uBottomEltype),real(tTypeNoUnits))

Expand Down
20 changes: 10 additions & 10 deletions src/caches/lamba_caches.jl
Expand Up @@ -17,14 +17,14 @@ du_cache(c::LambaEMCache) = (c.du1,c.du2,c.K,c.L)
alg_cache(alg::LambaEM,prob,u,ΔW,ΔZ,p,rate_prototype,noise_rate_prototype,uEltypeNoUnits,uBottomEltype,tTypeNoUnits,uprev,f,t,::Type{Val{false}}) = LambaEMConstantCache()

function alg_cache(alg::LambaEM,prob,u,ΔW,ΔZ,p,rate_prototype,noise_rate_prototype,uEltypeNoUnits,uBottomEltype,tTypeNoUnits,uprev,f,t,::Type{Val{true}})
du1 = zeros(rate_prototype); du2 = zeros(rate_prototype)
K = zeros(rate_prototype); tmp = zeros(u);
L = zeros(noise_rate_prototype)
gtmp = zeros(noise_rate_prototype)
du1 = zero(rate_prototype); du2 = zero(rate_prototype)
K = zero(rate_prototype); tmp = zero(u);
L = zero(noise_rate_prototype)
gtmp = zero(noise_rate_prototype)
if is_diagonal_noise(prob)
dW_cache = nothing
else
dW_cache = zeros(ΔW)
dW_cache = zero(ΔW)
end
LambaEMCache(u,uprev,du1,du2,K,tmp,L,gtmp,dW_cache)
end
Expand All @@ -48,14 +48,14 @@ du_cache(c::LambaEulerHeunCache) = (c.du1,c.du2,c.K,c.L)
alg_cache(alg::LambaEulerHeun,prob,u,ΔW,ΔZ,p,rate_prototype,noise_rate_prototype,uEltypeNoUnits,uBottomEltype,tTypeNoUnits,uprev,f,t,::Type{Val{false}}) = LambaEulerHeunConstantCache()

function alg_cache(alg::LambaEulerHeun,prob,u,ΔW,ΔZ,p,rate_prototype,noise_rate_prototype,uEltypeNoUnits,uBottomEltype,tTypeNoUnits,uprev,f,t,::Type{Val{true}})
du1 = zeros(rate_prototype); du2 = zeros(rate_prototype)
K = zeros(rate_prototype); tmp = zeros(u);
L = zeros(noise_rate_prototype)
gtmp = zeros(noise_rate_prototype)
du1 = zero(rate_prototype); du2 = zero(rate_prototype)
K = zero(rate_prototype); tmp = zero(u);
L = zero(noise_rate_prototype)
gtmp = zero(noise_rate_prototype)
if is_diagonal_noise(prob)
dW_cache = nothing
else
dW_cache = zeros(ΔW)
dW_cache = zero(ΔW)
end
LambaEulerHeunCache(u,uprev,du1,du2,K,tmp,L,gtmp,dW_cache)
end
8 changes: 4 additions & 4 deletions src/caches/predcorr_caches.jl
Expand Up @@ -11,13 +11,13 @@ struct PCEulerCache{uType,rateType,rateNoiseType,rateNoiseCollectionType} <: Sto
end

function alg_cache(alg::PCEuler,prob,u,ΔW,ΔZ,p,rate_prototype,noise_rate_prototype,uEltypeNoUnits,uBottomEltype,tTypeNoUnits,uprev,f,t,::Type{Val{true}})
utmp = zeros(u); ftmp = zeros(rate_prototype);
gtmp = zeros(noise_rate_prototype)
bbprimetmp = zeros(ftmp)
utmp = zero(u); ftmp = zero(rate_prototype);
gtmp = zero(noise_rate_prototype)
bbprimetmp = zero(ftmp)
if is_diagonal_noise(prob)
gdWtmp = gtmp
else
gdWtmp = zeros(rate_prototype)
gdWtmp = zero(rate_prototype)
end
PCEulerCache(utmp,ftmp,gtmp,gdWtmp,bbprimetmp)
end

0 comments on commit c266a53

Please sign in to comment.