Skip to content

Commit e56b7c2

Browse files
committed
Fix depwarns
1 parent 2918b2d commit e56b7c2

File tree

7 files changed

+34
-34
lines changed

7 files changed

+34
-34
lines changed

REQUIRE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ ParameterizedFunctions 2.0.0
33
DiffEqBase 3.0.3
44
DiffEqOperators
55
DiffEqBiological
6+
Reexport

src/DiffEqProblemLibrary.jl

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,20 @@ __precompile__(true)
22

33
module DiffEqProblemLibrary
44

5-
const file = @__FILE__
6-
75
module ODEProblemLibrary
8-
importodeproblems() = @eval ODEProblemLibrary include(joinpath(@__DIR__, "ode/ode_premade_problems.jl"))
6+
importodeproblems() = @eval include(joinpath(@__DIR__, "ode/ode_premade_problems.jl"))
97
end # module
108
module DAEProblemLibrary
11-
importdaeproblems() = @eval DAEProblemLibrary include(joinpath(@__DIR__, "dae_premade_problems.jl"))
9+
importdaeproblems() = @eval include(joinpath(@__DIR__, "dae_premade_problems.jl"))
1210
end # module
1311
module DDEProblemLibrary
14-
importddeproblems() = @eval DDEProblemLibrary include(joinpath(@__DIR__, "dde_premade_problems.jl"))
12+
importddeproblems() = @eval include(joinpath(@__DIR__, "dde_premade_problems.jl"))
1513
end # module
1614
module SDEProblemLibrary
17-
importsdeproblems() = @eval SDEProblemLibrary include(joinpath(@__DIR__, "sde_premade_problems.jl"))
15+
importsdeproblems() = @eval include(joinpath(@__DIR__, "sde_premade_problems.jl"))
1816
end # module
1917
module JumpProblemLibrary
20-
importjumpproblems() = @eval JumpProblemLibrary include(joinpath(@__DIR__, "src/jump_premade_problems.jl"))
18+
importjumpproblems() = @eval include(joinpath(@__DIR__, "src/jump_premade_problems.jl"))
2119
end # module
2220

2321
end # module

src/ode/brusselator_prob.jl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ function brusselator_2d_loop(du, u, p, t)
1313
@inbounds begin
1414
A, B, α, xyd, dx, N = p
1515
α = α/dx^2
16-
for I in CartesianRange((N, N))
16+
for I in CartesianIndices((N, N))
1717
x = xyd[I[1]]
1818
y = xyd[I[2]]
1919
i = I[1]
@@ -25,7 +25,7 @@ function brusselator_2d_loop(du, u, p, t)
2525
du[i,j,1] = α*(u[im1,j,1] + u[ip1,j,1] + u[i,jp1,1] + u[i,jm1,1] - 4u[i,j,1]) +
2626
B + u[i,j,1]^2*u[i,j,2] - (A + 1)*u[i,j,1] + brusselator_f(x, y, t)
2727
end
28-
for I in CartesianRange((N, N))
28+
for I in CartesianIndices((N, N))
2929
i = I[1]
3030
j = I[2]
3131
ip1 = limit(i+1, N)
@@ -40,17 +40,17 @@ end
4040
function init_brusselator_2d(xyd)
4141
N = length(xyd)
4242
u = zeros(N, N, 2)
43-
for I in CartesianRange((N, N))
43+
for I in CartesianIndices((N, N))
4444
x = xyd[I[1]]
4545
y = xyd[I[2]]
4646
u[I,1] = 22*(y*(1-y))^(3/2)
4747
u[I,2] = 27*(x*(1-x))^(3/2)
4848
end
4949
u
5050
end
51-
xyd_brusselator = linspace(0,1,32)
51+
xyd_brusselator = range(0,stop=1,length=32)
5252

53-
doc"""
53+
@doc @doc doc"""
5454
2D Brusselator
5555
5656
```math
@@ -120,15 +120,15 @@ function brusselator_1d(du, u_, p, t)
120120
end
121121
function init_brusselator_1d(N)
122122
u = zeros(N, 2)
123-
x = linspace(0, 1, N)
123+
x = range(0, stop=1, length=N)
124124
for i in 1:N
125125
u[i, 1] = 1 + sin(2pi*x[i])
126126
u[i, 2] = 3.
127127
end
128128
u
129129
end
130130

131-
doc"""
131+
@doc @doc doc"""
132132
1D Brusselator
133133
134134
```math

src/ode/filament_prob.jl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@ struct NoHydroProjectionCache <: AbstractInextensibilityCache
3535
J :: Matrix{T}
3636
P :: Matrix{T}
3737
J_JT :: Matrix{T}
38-
J_JT_LDLT :: Base.LinAlg.LDLt{T, SymTridiagonal{T}}
38+
J_JT_LDLT :: LinearAlgebra.LDLt{T, SymTridiagonal{T}}
3939
P0 :: Matrix{T}
4040

4141
NoHydroProjectionCache(N::Int) = new(
4242
zeros(N, 3*(N+1)), # J
4343
zeros(3*(N+1), 3*(N+1)), # P
4444
zeros(N,N), # J_JT
45-
Base.LinAlg.LDLt{T,SymTridiagonal{T}}(SymTridiagonal(zeros(N), zeros(N-1))),
45+
LinearAlgebra.LDLt{T,SymTridiagonal{T}}(SymTridiagonal(zeros(N), zeros(N-1))),
4646
zeros(N, 3*(N+1))
4747
)
4848
end
@@ -66,7 +66,7 @@ function FilamentCache(N=20; Cm=32, ω=200, Solver=SolverDiffEq)
6666
end
6767
function stiffness_matrix!(f::AbstractFilamentCache)
6868
N, μ, A = f.N, f.μ, f.A
69-
A[:] = eye(3*(N+1))
69+
A[:] = Matrix{Float64}(I, 3*(N+1), 3*(N+1))
7070
for i in 1 : 3
7171
A[i,i] = 1
7272
A[i,3+i] = -2
@@ -94,7 +94,7 @@ function stiffness_matrix!(f::AbstractFilamentCache)
9494
A[3*j+i,3*(j+2)+i] = 1
9595
end
9696
end
97-
scale!(A, -μ^4)
97+
rmul!(A, -μ^4)
9898
nothing
9999
end
100100
function update_separate_coordinates!(f::AbstractFilamentCache, r)
@@ -126,7 +126,7 @@ end
126126
function initialize!(initial_conf_type::Symbol, f::AbstractFilamentCache)
127127
N, x, y, z = f.N, f.x, f.y, f.z
128128
if initial_conf_type == :StraightX
129-
x[:] = linspace(0, 1, N+1)
129+
x[:] = range(0, stop=1, length=N+1)
130130
y[:] = 0 .* x
131131
z[:] = 0 .* x
132132
else
@@ -192,14 +192,14 @@ function projection!(f::FilamentCache)
192192
end
193193

194194
function subtract_from_identity!(A)
195-
scale!(-1, A)
195+
rmul!(-1, A)
196196
@inbounds for i in 1 : size(A,1)
197197
A[i,i] += 1
198198
end
199199
nothing
200200
end
201201

202-
function LDLt_inplace!{T<:Real}(L::Base.LinAlg.LDLt{T,SymTridiagonal{T}}, A::Matrix{T})
202+
function LDLt_inplace!(L::LinearAlgebra.LDLt{T,SymTridiagonal{T}}, A::Matrix{T}) where {T<:Real}
203203
n = size(A,1)
204204
dv, ev = L.data.dv, L.data.ev
205205
@inbounds for (i,d) in enumerate(diagind(A))

src/ode/ode_premade_problems.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using DiffEqBase, ParameterizedFunctions, DiffEqOperators, Random, LinearAlgebra
1+
using DiffEqBase, ParameterizedFunctions, DiffEqOperators, Random, LinearAlgebra,
2+
Markdown
23

34
srand(100)
45

src/ode/pollution_prob.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ u0[8] = 0.3
188188
u0[9] = 0.01
189189
u0[17] = 0.007
190190

191-
doc"""
191+
@doc doc"""
192192
[Pollution Problem](http://nbviewer.jupyter.org/github/JuliaDiffEq/DiffEqBenchmarks.jl/blob/master/StiffODE/Pollution.ipynb) (Stiff)
193193
194194
This IVP is a stiff system of 20 non-linear Ordinary Differential Equations. It is in the form of ``\\frac{dy}{dt}=f(y), \\quad y(0)=y0,`` with

src/sde_premade_problems.jl

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ f = (u,p,t) -> 1.01u
1414
σ = (u,p,t) -> 0.87u
1515
(ff::typeof(f))(::Type{Val{:analytic}},u0,p,t,W) = u0.*exp.(0.63155t+0.87W)
1616

17-
doc"""
17+
@doc doc"""
1818
```math
1919
du_t = βudt + αudW_t
2020
```
@@ -43,7 +43,7 @@ end
4343
end
4444
end
4545
(ff::typeof(f))(::Type{Val{:analytic}},u0,p,t,W) = u0.*exp.(0.63155*t+0.87*W)
46-
doc"""
46+
@doc doc"""
4747
8 linear SDEs (as a 4x2 matrix):
4848
4949
```math
@@ -73,7 +73,7 @@ prob_sde_2Dlinear_stratonovich = SDEProblem(f,σ,ones(4,2)/2,(0.0,1.0))
7373
f = (u,p,t) -> -.25*u*(1-u^2)
7474
σ = (u,p,t) -> .5*(1-u^2)
7575
(ff::typeof(f))(::Type{Val{:analytic}},u0,p,t,W) = ((1+u0).*exp.(W)+u0-1)./((1+u0).*exp.(W)+1-u0)
76-
doc"""
76+
@doc doc"""
7777
```math
7878
du_t = \\frac{1}{4}u(1-u^2)dt + \\frac{1}{2}(1-u^2)dW_t
7979
```
@@ -89,7 +89,7 @@ prob_sde_cubic = SDEProblem(f,σ,1/2,(0.0,1.0))
8989
f = (u,p,t) -> -0.01*sin.(u).*cos.(u).^3
9090
σ = (u,p,t) -> 0.1*cos.(u).^2
9191
(ff::typeof(f))(::Type{Val{:analytic}},u0,p,t,W) = atan.(0.1*W + tan.(u0))
92-
doc"""
92+
@doc doc"""
9393
```math
9494
du_t = -\\frac{1}{100}\sin(u)\cos^3(u)dt + \\frac{1}{10}\cos^{2}(u_t) dW_t
9595
```
@@ -107,7 +107,7 @@ f = (u,p,t) -> p[2]./sqrt.(1+t) - u./(2*(1+t))
107107
p = (0.1,0.05)
108108
(ff::typeof(f))(::Type{Val{:analytic}},u0,p,t,W) = u0./sqrt.(1+t) + p[2]*(t+p[1]*W)./sqrt.(1+t)
109109

110-
doc"""
110+
@doc doc"""
111111
Additive noise problem
112112
113113
```math
@@ -137,7 +137,7 @@ end
137137
end
138138
(ff::typeof(f))(::Type{Val{:analytic}},u0,p,t,W) = u0./sqrt(1+t) + sde_wave_βvec.*(t+sde_wave_αvec.*W)./sqrt(1+t)
139139

140-
doc"""
140+
@doc doc"""
141141
A multiple dimension extension of `additiveSDEExample`
142142
143143
"""
@@ -154,7 +154,7 @@ end σ ρ β
154154
du[i] = 3.0 #Additive
155155
end
156156
end
157-
doc"""
157+
@doc doc"""
158158
Lorenz Attractor with additive noise
159159
160160
```math
@@ -173,7 +173,7 @@ prob_sde_lorenz = SDEProblem(f,σ,ones(3),(0.0,10.0),(10.0,28.0,2.66))
173173
f = (u,p,t) -> (1/3)*u^(1/3) + 6*u^(2/3)
174174
σ = (u,p,t) -> u^(2/3)
175175
(ff::typeof(f))(::Type{Val{:analytic}},u0,p,t,W) = (2t + 1 + W/3)^3
176-
doc"""
176+
@doc doc"""
177177
Runge–Kutta methods for numerical solution of stochastic differential equations
178178
Tocino and Ardanuy
179179
"""
@@ -346,7 +346,7 @@ function stiff_quad_f_strat(::Type{Val{:analytic}},u0,p,t,W)
346346
(tmp*exp_tmp + u0 - 1)/(tmp*exp_tmp - u0 + 1)
347347
end
348348

349-
doc"""
349+
@doc doc"""
350350
The composite Euler method for stiff stochastic
351351
differential equations
352352
@@ -365,7 +365,7 @@ Higher α or β is stiff, with α being deterministic stiffness and
365365
"""
366366
prob_sde_stiffquadito = SDEProblem(stiff_quad_f_ito,stiff_quad_g,0.5,(0.0,3.0),(1.0,1.0))
367367

368-
doc"""
368+
@doc doc"""
369369
The composite Euler method for stiff stochastic
370370
differential equations
371371
@@ -384,7 +384,7 @@ Higher α or β is stiff, with α being deterministic stiffness and
384384
"""
385385
prob_sde_stiffquadstrat = SDEProblem(stiff_quad_f_strat,stiff_quad_g,0.5,(0.0,3.0),(1.0,1.0))
386386

387-
doc"""
387+
@doc doc"""
388388
Stochastic Heat Equation with scalar multiplicative noise
389389
390390
S-ROCK: CHEBYSHEV METHODS FOR STIFF STOCHASTIC

0 commit comments

Comments
 (0)