-
-
Notifications
You must be signed in to change notification settings - Fork 121
Closed
Description
I have a function with explicitly stated constrained generic arguments:
function equation!{T<:Real, U <:AbstractUnsaturatedModel{T}, V <: Inlet{T}}(t :: T, s :: Vector{T}, d :: Darcy{T,U,V}, Ds :: Vector{T})Creating a parameterized function as
ParameterizedFunction(equation!, d)Results in error in numargs (utils.jl) function that seems unable to calculate correctly the number of arguments of such a generic function. The problem is in the call
m.sig.parameterswhere m is a method of equation!: there is no field parameters for my function.
For something simpler it works:
function lz(t, u, du)
σ = 10.0
ρ = 28.0
β = 8/3.0
du[1] = σ*(u[2]-u[1])
du[2] = u[1]*(ρ-u[3]) - u[2]
du[3] = u[1]*u[2] - β*u[3]
end
first(methods(lz)).sig.parameterssvec(DarcyExample.#lz, Any, Any, Any)
However the change to explicit argument type results in error:
function lz1{T<:Real}(t::T, u::Vector{T}, du::Vector{T})
σ = 10.0
ρ = 28.0
β = 8/3.0
du[1] = σ*(u[2]-u[1])
du[2] = u[1]*(ρ-u[3]) - u[2]
du[3] = u[1]*u[2] - β*u[3]
end
first(methods(lz1)).sig.parameterstype UnionAll has no field parameters
Metadata
Metadata
Assignees
Labels
No labels