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

Implement empty! and is_empty for MOI.Nonlinear.Model #2302

Closed
blegat opened this issue Oct 5, 2023 · 5 comments · Fixed by #2305
Closed

Implement empty! and is_empty for MOI.Nonlinear.Model #2302

blegat opened this issue Oct 5, 2023 · 5 comments · Fixed by #2305

Comments

@blegat
Copy link
Member

blegat commented Oct 5, 2023

Would be useful for JuliaManifolds/Manopt.jl#264

@odow
Copy link
Member

odow commented Oct 5, 2023

Just build a new one? MOI.Nonlinear.Model does not follow the full MOI API.

@blegat
Copy link
Member Author

blegat commented Oct 5, 2023

Indeed, it's a bit confusing it does not

@odow
Copy link
Member

odow commented Oct 6, 2023

Not really, it doesn't add variables via add_variable, it doesn't manage the objective via set(m, ::ObjectiveFunction) because the function type is Expr, and so on. It's not a heavy lift to have to create a new one rather than call empty!.

@blegat
Copy link
Member Author

blegat commented Oct 6, 2023

Ok but I guess is_empty would still be useful, I was wondering why Ipopt was not checking the nlp_model fields in its MOI.is_empty

@odow
Copy link
Member

odow commented Oct 6, 2023

You don't really need this for ManOpt: https://github.com/JuliaManifolds/Manopt.jl/pull/264/files#r1348482364

And I guess for ipopt we could check if nlp_model === nothing, but it's not really important.
https://github.com/jump-dev/Ipopt.jl/blob/e01818b6bde26ef779df08be9108694e75613b41/src/MOI_wrapper.jl#L105C5-L105C20

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

Successfully merging a pull request may close this issue.

2 participants