The documentation of ADNLPModels.ADNLPModel
suggests that there are methods that accept a matrix A
to signify linear constraints:
ADNLPModel(f, x0, A, lcon, ucon)
ADNLPModel(f, x0, lvar, uvar, A, lcon, ucon)
These constructors are also successfully tested on GitHub.
However, I get an error when I try to use this:
params0 = [1.0, 0.1, 0.9]
A = sparse([
0 -1 1
])
problem = ADNLPModels.ADNLPModel(
nll, params0, # f, x0
[0, 0, 0], [Inf, Inf, 1], # lvar, uvar
A, [0], [Inf] # A, lcon, ucon
)
Error:
MethodError: no method matching ADNLPModels.ADNLPModel(::Main.var"workspace#51".var"#nll#5"{Main.var"workspace#51".GARCHLearner{Float64}, Vector{Float64}}, ::Vector{Float64}, ::Vector{Int64}, ::Vector{Float64}, ::SparseArrays.SparseMatrixCSC{Int64, Int64}, ::Vector{Int64}, ::Vector{Float64})
The type `ADNLPModels.ADNLPModel` exists, but no method is defined for this combination of argument types when trying to construct it.
Closest candidates are:
ADNLPModels.ADNLPModel(::Any, ::Any, ::Any, ::Any, ::SparseArrays.AbstractSparseMatrix{Tv, Ti}, ::Any, ::Any, ::Any; kwargs...) where {Tv, Ti}
@ ADNLPModels ~/.julia/packages/ADNLPModels/bOFzz/src/nlp.jl:507
ADNLPModels.ADNLPModel(::Any, ::S, ::Any, ::Any, ::S, ::Any, ::S, ::S; kwargs...) where S
@ ADNLPModels ~/.julia/packages/ADNLPModels/bOFzz/src/nlp.jl:240
ADNLPModels.ADNLPModel(::Any, ::S, ::S, ::S, ::Any, ::Any, ::S, ::S, ::S; kwargs...) where S
@ ADNLPModels ~/.julia/packages/ADNLPModels/bOFzz/src/nlp.jl:330
...
What am I doing wrong?