Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

There should be a single connection to the "outside" #162

Open
abelsiqueira opened this issue May 31, 2024 · 1 comment
Open

There should be a single connection to the "outside" #162

abelsiqueira opened this issue May 31, 2024 · 1 comment

Comments

@abelsiqueira
Copy link
Member

The pipeline should be clearer.

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

  1. minimize(args...; kwargs...) # Maybe some variants
  2. minimize(solver, nlp; kwargs...) with no variants
  3. 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).

Maybe we'll need an intermediary function.

@tmigot
Copy link
Member

tmigot commented Jun 11, 2024

Ok, so minimize call _create_problem (if the argument is not an NLPModel) and then solve?
I like the idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants