I tried the example here and see what @code_warntype
returns:
julia> using DifferentialEquations
julia> function lorenz(du,u,p,t)
du[1] = 10.0*(u[2]-u[1])
du[2] = u[1]*(28.0-u[3]) - u[2]
du[3] = u[1]*u[2] - (8/3)*u[3]
end
lorenz (generic function with 1 method)
julia> u0 = [1.0;0.0;0.0]
3-element Array{Float64,1}:
1.0
0.0
0.0
julia> tspan = (0.0,100.0)
(0.0, 100.0)
julia> @code_warntype ODEProblem(lorenz,u0,tspan)
Variables:
#self#::Type{DiffEqBase.ODEProblem}
f::#lorenz
u0::Array{Float64,1}
tspan::Tuple{Float64,Float64}
Body:
begin
return $(Expr(:invoke, MethodInstance for #ODEProblem#185(::Array{Any,1}, ::Type{T} where T, ::Function, ::Array{Float64,1}, ::Tuple{Float64,Float64}, ::Void), :(DiffEqBase.#ODEProblem#185), :($(Expr(:foreigncall, :(:jl_alloc_array_1d), Array{Any,1}, svec(Any, Int64), Array{Any,1}, 0, 0, 0))), :(#self#), :(f), :(u0), :(tspan), :(DiffEqBase.nothing)))
end::Any
Under what circumstances will it return a type other than DiffEqBase.ODEProblem
? If I embed it into some simulation code, it will return Any
, would that affect performance?