You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
t, =@parameters t; vars = [Variable(Symbol(:x, i))(t) for i ineachindex(prob.u0)]; params = [Variable(Symbol(:α, i); known =true)() for i ineachindex(prob.p)];
101
-
D, =@derivatives D'~t
102
-
103
-
rhs = [D(var) for var in vars]
104
-
105
-
if DiffEqBase.isinplace(prob)
106
-
lhs =similar(vars, Any)
107
-
prob.f(lhs, vars, params, t)
108
-
else
109
-
lhs = prob.f(vars, params, t)
110
-
end
111
-
112
-
eqs =vcat([rhs[i] ~ lhs[i] for i ineachindex(prob.u0)]...)
113
-
de =ODESystem(eqs)
114
-
115
-
de, vars, params
95
+
@inline@generatedfunctionfast_invokelatest(f, ::Type{rt}, args...) where rt
96
+
tupargs =Expr(:tuple,(a==Nothing ? Int : a for a in args)...)
97
+
quote
98
+
_f =$(Expr(:cfunction, Base.CFunction, :f, rt, :((Core.svec)($((a==Nothing ? Int : a for a in args)...))), :(:ccall)))
99
+
returnccall(_f.ptr,rt,$tupargs,$((:(getindex(args,$i) ===nothing?0:getindex(args,$i)) for i in1:length(args))...))
0 commit comments