JuliaSmoothOptimizers / QuadraticModels.jl

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

Fix nlpmodif compat #98

Closed tmigot closed 2 years ago

tmigot commented 2 years ago

@geoffroyleconte The update of what you sent me. Could you verify that it works with https://github.com/JuliaSmoothOptimizers/NLPModelsModifiers.jl/pull/66 ?

tmigot commented 2 years ago

Besides, another thing would be to add consistent_nlps(nlps, linear_api = true) instead of just consistent_nlps(nlps)

geoffroyleconte commented 2 years ago

Why the changes on the test problems? I think that QuadraticModels was supposed to work on them before. Also I don't think that the function get_slack_ind is ever called in QuadraticModels since it uses its own SlackModel (which returns a QuadraticModel). But I'm not 100% sure because I do not really know what is doing NLPModelsTests, maybe it is using other AbstractNLPModels that are not QuadraticModels?

tmigot commented 2 years ago

I modified the problem using ADNLPModel, because there is now a specific constructor for the linear constraints.

NLPModelsTest test the consistency of the current model, but it also test the consistency of the slack-version of the model, cf https://github.com/JuliaSmoothOptimizers/NLPModelsTest.jl/blob/c535a4ce22774dc9bc7fb9e720a30a68fa515888/src/nlp/consistency.jl#L15. There was a bug of the slack version of the ADNLPModel

geoffroyleconte commented 2 years ago

OK thanks! So the QuadraticModels.jl tests call SlackModel on a model that is not a QuadraticModel at some point if I understood correctly? I still get the same error message.

tmigot commented 2 years ago

Yes, the last issues are not coming from the QuadraticModels but from the ADModels you are comparing to.

Weird, it does pass on my computer with the following config:

     Project QuadraticModels v0.8.1
      Status `C:\Users\tangi\Documents\cvs\QuadraticModels.jl\Project.toml`
  [54578032] ADNLPModels v0.4.0
  [5c8ed15e] LinearOperators v2.3.2
  [a4795742] NLPModels v0.19.0
  [e01155f1] NLPModelsModifiers v0.6.1 `https://github.com/JuliaSmoothOptimizers/NLPModelsModifiers.jl#fix-bug-slack`
  [7998695d] NLPModelsTest v0.8.1
  [10f199a5] QPSReader v0.2.1
  [ae029012] Requires v1.3.0
  [ff4d7338] SolverCore v0.2.4
  [fa32481b] SparseMatricesCOO v0.1.1
  [37e2e46d] LinearAlgebra
  [2f01184e] SparseArrays
geoffroyleconte commented 2 years ago

Oh ok my bad I did not take the right branch. This does work for me too.

tmigot commented 2 years ago

Hey @geoffroyleconte ! It works well for me, now.