Skip to content

Commit bb9a56c

Browse files
committed
remove @inline
1 parent 805c8c1 commit bb9a56c

File tree

4 files changed

+29
-29
lines changed

4 files changed

+29
-29
lines changed

src/continuous_famous_systems.jl

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ function's documentation string.
2727
function lorenz(u0=[0.0, 10.0, 0.0]; σ = 10.0, ρ = 28.0, β = 8/3)
2828
return CDS(loop, u0, [σ, ρ, β], loop_jac)
2929
end
30-
@inline @inbounds function loop(u, p, t)
30+
@inbounds function loop(u, p, t)
3131
σ = p[1]; ρ = p[2]; β = p[3]
3232
du1 = σ*(u[2]-u[1])
3333
du2 = u[1]*-u[3]) - u[2]
3434
du3 = u[1]*u[2] - β*u[3]
3535
return SVector{3}(du1, du2, du3)
3636
end
37-
@inline @inbounds function loop_jac(u, p, t)
37+
@inbounds function loop_jac(u, p, t)
3838
σ, ρ, β = p
3939
J = @SMatrix [-σ σ 0;
4040
ρ - u[3] (-1) (-u[1]);
@@ -45,14 +45,14 @@ end
4545
function lorenz_iip(u0=[0.0, 10.0, 0.0]; σ = 10.0, ρ = 28.0, β = 8/3)
4646
return CDS(liip, u0, [σ, ρ, β], liip_jac)
4747
end
48-
@inline @inbounds function liip(du, u, p, t)
48+
@inbounds function liip(du, u, p, t)
4949
σ = p[1]; ρ = p[2]; β = p[3]
5050
du[1] = σ*(u[2]-u[1])
5151
du[2] = u[1]*-u[3]) - u[2]
5252
du[3] = u[1]*u[2] - β*u[3]
5353
return nothing
5454
end
55-
@inline @inbounds function liip_jac(J, u, p, t)
55+
@inbounds function liip_jac(J, u, p, t)
5656
σ, ρ, β = p
5757
J[1,1] = -σ; J[1, 2] = σ; J[1,3] = 0
5858
J[2,1] = ρ - u[3]; J[2,2] = -1; J[2,3] = -u[1]
@@ -87,14 +87,14 @@ function's documentation string.
8787
function roessler(u0=rand(3); a = 0.2, b = 0.2, c = 5.7)
8888
return CDS(roessler_eom, u0, [a, b, c], roessler_jacob)
8989
end
90-
@inline @inbounds function roessler_eom(u, p, t)
90+
@inbounds function roessler_eom(u, p, t)
9191
a, b, c = p
9292
du1 = -u[2]-u[3]
9393
du2 = u[1] + a*u[2]
9494
du3 = b + u[3]*(u[1] - c)
9595
return SVector{3, Float64}(du1, du2, du3)
9696
end
97-
@inline @inbounds function roessler_jacob(u, p, t)
97+
@inbounds function roessler_jacob(u, p, t)
9898
a, b, c = p
9999
return @SMatrix [0 (-1) (-1);
100100
1 a 0;
@@ -168,10 +168,10 @@ function henonheiles(u0=[0, -0.25, 0.42081, 0]#=; conserveE::Bool = true=#)
168168
o = zero(eltype(u0))
169169
J = zeros(eltype(u0), 4, 4)
170170

171-
# @inline Vhh(q1, q2) = 1//2 * (q1^2 + q2^2 + 2q1^2 * q2 - 2//3 * q2^3)
172-
# @inline Thh(p1, p2) = 1//2 * (p1^2 + p2^2)
173-
# @inline Hhh(q1, q2, p1, p2) = Thh(p1, p2) + Vhh(q1, q2)
174-
# @inline Hhh(u::AbstractVector) = Hhh(u...)
171+
# Vhh(q1, q2) = 1//2 * (q1^2 + q2^2 + 2q1^2 * q2 - 2//3 * q2^3)
172+
# Thh(p1, p2) = 1//2 * (p1^2 + p2^2)
173+
# Hhh(q1, q2, p1, p2) = Thh(p1, p2) + Vhh(q1, q2)
174+
# Hhh(u::AbstractVector) = Hhh(u...)
175175
#
176176
# E = Hhh(u0)
177177
#

src/discrete.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ function reinit!(integ::MDI, u = integ.u, Q0 = nothing)
3030
return
3131
end
3232

33-
@inline function (integ::MinimalDiscreteIntegrator)(t::Real)
33+
function (integ::MinimalDiscreteIntegrator)(t::Real)
3434
if t == integ.t
3535
return integ.u
3636
else

src/discrete_famous_systems.jl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ Default values are the ones used in the original paper.
2323
function towel(u0=[0.085, -0.121, 0.075])
2424
return DDS(eom_towel, u0, nothing, jacob_towel)
2525
end# should result in lyapunovs: [0.432207,0.378834,-3.74638]
26-
@inline function eom_towel(x, p, n)
26+
function eom_towel(x, p, n)
2727
@inbounds x1, x2, x3 = x[1], x[2], x[3]
2828
SVector( 3.8*x1*(1-x1) - 0.05*(x2+0.35)*(1-2*x3),
2929
0.1*( (x2+0.35)*(1-2*x3) - 1 )*(1 - 1.9*x1),
3030
3.78*x3*(1-x3)+0.2*x2 )
3131
end
32-
@inline function jacob_towel(x, p, n)
32+
function jacob_towel(x, p, n)
3333
@SMatrix [3.8*(1 - 2x[1]) -0.05*(1-2x[3]) 0.1*(x[2] + 0.35);
3434
-0.19((x[2] + 0.35)*(1-2x[3]) - 1) 0.1*(1-2x[3])*(1-1.9x[1]) -0.2*(x[2] + 0.35)*(1-1.9x[1]);
3535
0.0 0.2 3.78(1-2x[3]) ]
@@ -96,7 +96,7 @@ Nuclear Physics, Novosibirsk (1969)
9696
function standardmap(u0=0.001rand(2); k = 0.971635)
9797
return DDS(standardmap_eom, u0, [k], standardmap_jacob)
9898
end
99-
@inline @inbounds function standardmap_eom(x, par, n)
99+
@inbounds function standardmap_eom(x, par, n)
100100
theta = x[1]; p = x[2]
101101
p += par[1]*sin(theta)
102102
theta += p
@@ -106,7 +106,7 @@ end
106106
while p < 0; p += twopi; end
107107
return SVector(theta, p)
108108
end
109-
@inline @inbounds standardmap_jacob(x, p, n) =
109+
@inbounds standardmap_jacob(x, p, n) =
110110
@SMatrix [1 + p[1]*cos(x[1]) 1;
111111
p[1]*cos(x[1]) 1]
112112

@@ -221,8 +221,8 @@ function's documentation string.
221221
function henon(u0=zeros(2); a = 1.4, b = 0.3)
222222
return DDS(hoop, u0, [a,b], hoop_jac)
223223
end # should give lyapunov exponents [0.4189, -1.6229]
224-
@inline hoop(x, p, n) = SVector{2}(1.0 - p[1]*x[1]^2 + x[2], p[2]*x[1])
225-
@inline hoop_jac(x, p, n) = @SMatrix [-2*p[1]*x[1] 1.0; p[2] 0.0]
224+
hoop(x, p, n) = SVector{2}(1.0 - p[1]*x[1]^2 + x[2], p[2]*x[1])
225+
hoop_jac(x, p, n) = @SMatrix [-2*p[1]*x[1] 1.0; p[2] 0.0]
226226

227227
function henon_iip(u0=zeros(2); a = 1.4, b = 0.3)
228228
return DDS(hiip, u0, [a, b], hiip_jac)
@@ -265,5 +265,5 @@ function's documentation string.
265265
function logistic(x0=rand(); r = 4.0)
266266
return DDS(logistic_eom, x0, [r], logistic_jacob)
267267
end
268-
@inline logistic_eom(x, p, n) = p[1]*x*(1-x)
269-
@inline logistic_jacob(x, p, n) = p[1]*(1-2x)
268+
logistic_eom(x, p, n) = p[1]*x*(1-x)
269+
logistic_jacob(x, p, n) = p[1]*(1-2x)

src/dynamicalsystem.jl

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,10 @@ const DDS = DiscreteDynamicalSystem
140140
systemtype(::DDS) = "discrete"
141141

142142

143-
@inline isinplace(::DS{IIP}) where {IIP} = IIP
144-
@inline statetype(::DS{IIP, S}) where {IIP, S} = S
145-
@inline stateeltype(::DS{IIP, S}) where {IIP, S} = eltype(S)
146-
@inline isautodiff(::DS{IIP, S, D, F, P, JAC, JM, IAD}) where
143+
isinplace(::DS{IIP}) where {IIP} = IIP
144+
statetype(::DS{IIP, S}) where {IIP, S} = S
145+
stateeltype(::DS{IIP, S}) where {IIP, S} = eltype(S)
146+
isautodiff(::DS{IIP, S, D, F, P, JAC, JM, IAD}) where
147147
{IIP, S, D, F, P, JAC, JM, IAD} = IAD
148148

149149
get_state(ds::DS) = ds.u0
@@ -288,7 +288,7 @@ end
288288
#######################################################################################
289289
# Jacobians #
290290
#######################################################################################
291-
@inline function create_jacobian(
291+
function create_jacobian(
292292
f::F, ::Val{IIP}, s::S, p::P, t::T, ::Val{D}) where {F, IIP, S, P, T, D}
293293
if IIP
294294
dum = deepcopy(s)
@@ -311,7 +311,7 @@ end
311311
end
312312
end
313313

314-
@inline function get_J(jacob, u0, p, t0, iip) where {JAC}
314+
function get_J(jacob, u0, p, t0, iip) where {JAC}
315315
D = length(u0)
316316
if iip
317317
J = similar(u0, (D,D))
@@ -340,7 +340,7 @@ ds.jacobian(u, ds.p, t)
340340
# Tanget Dynamics #
341341
#######################################################################################
342342
# IIP Tangent Space dynamics
343-
@inline function create_tangent(f::F, jacobian::JAC, J::JM,
343+
function create_tangent(f::F, jacobian::JAC, J::JM,
344344
::Val{true}, ::Val{k}) where {F, JAC, JM, k}
345345
J = deepcopy(J)
346346
tangentf = (du, u, p, t) -> begin
@@ -376,7 +376,7 @@ end
376376

377377

378378
# OOP Tangent Space dynamics
379-
@inline function create_tangent(f::F, jacobian::JAC, J::JM,
379+
function create_tangent(f::F, jacobian::JAC, J::JM,
380380
::Val{false}, ::Val{k}) where {F, JAC, JM, k}
381381

382382
ws_index = SVector{k, Int}(2:(k+1)...)
@@ -390,8 +390,8 @@ struct TangentOOP{F, JAC, k} <: Function
390390
end
391391
function (tan::TangentOOP)(u, p, t)
392392
@inbounds s = u[:, 1]
393-
@inbounds du = tan.f(s, p, t)
394-
@inbounds J = tan.jacobian(s, p, t)
393+
du = tan.f(s, p, t)
394+
J = tan.jacobian(s, p, t)
395395
@inbounds dW = J*u[:, tan.ws]
396396
return hcat(du, dW)
397397
end

0 commit comments

Comments
 (0)