We should have a single "final" function, i.e., the last function in the pipeline, that will call solve!. This solve! call should resolve to the specific solver definition, while all others should dispatch to internal calls.
Right now there are at least three places that call external functions:
minimize in solve.jl
solve! in solve-model.jl
minimize in ipopt_solve.jl
To simplify argument passing, we should focus on a simpler pipeline. Something like
minimize(args...; kwargs...) # Maybe some variants
minimize(solver, nlp; kwargs...) with no variants
solve!(solver, nlp, ...) external call
Then internally, we can a new function _create_problem that dispatches on the arguments, instead of minimize.
Then we have function 1 to create nlp, call select_optimizers, define the solver, and call function 2.
Function 2 serves mainly to define our interface to call solve! (function 3).
The pipeline should be clearer.
We should have a single "final" function, i.e., the last function in the pipeline, that will call
solve!
. Thissolve!
call should resolve to the specific solver definition, while all others should dispatch to internal calls. Right now there are at least three places that call external functions:minimize
insolve.jl
solve!
insolve-model.jl
minimize
inipopt_solve.jl
To simplify argument passing, we should focus on a simpler pipeline. Something like
Then internally, we can a new function
_create_problem
that dispatches on the arguments, instead ofminimize
.Then we have function 1 to create
nlp
, callselect_optimizers
, define the solver, and call function 2. Function 2 serves mainly to define our interface to callsolve!
(function 3).Maybe we'll need an intermediary function.