JuliaSmoothOptimizers / QuadraticModels.jl

Data structures for linear and quadratic optimization problems based on NLPModels.jl
Other
16 stars 10 forks source link

SlackModel for QuadraticModels #30

Closed geoffroyleconte closed 3 years ago

geoffroyleconte commented 3 years ago

This allows to get H and A faster after using SlackModel. I modified qp.data, and created another meta using the code already written in NLPModels.slack_meta.

dpo commented 3 years ago

Great, thank you. Do this work for you in RipQP?

When you've converged on the right design, it would be great to add a test.

geoffroyleconte commented 3 years ago

I'm working on it with RipQP. Is it a problem if SlackModel changes its argument? I did not found SlackModel! in NLPModels

dpo commented 3 years ago

Is it a problem if SlackModel changes its argument?

In what sense?

geoffroyleconte commented 3 years ago

If the user wants to have the initial QuadraticModel and the QuadraticModel with the slack variables in two different objects.

dpo commented 3 years ago

I think the user will often want to keep the original QP separate from the slack QP, so it's fine to copy data as you did.

However, for QPs, it could also be useful to write SlackModel!. I like the idea. Could you open an issue and open a separate PR?

geoffroyleconte commented 3 years ago

I did not copy qp.data, I only copied qp.meta (I think). What about in this pull request? The two are similar. Or do you mean a pull request in NLPModels?

dpo commented 3 years ago

I'm sorry. I didn't realize that you were modifying qp.data directly! I think what you implemented here is fine, but it doesn't match NLPModels.SlackModel (which doesn't modify the user's problem). You could call your method SlackModel! and only make it part of QuadraticModels. It would be great to add a few tests though to validate the slack model.

dpo commented 3 years ago

Thank you! 🎉