GAMS-dev / gams.jl

A MathOptInterface Optimizer to solve JuMP models using GAMS
MIT License
35 stars 3 forks source link

GeneratedConstraintName() for Non linear constraints #23

Closed jagomezm4 closed 6 months ago

jagomezm4 commented 1 year ago

I need to find the name with which a Julia equation is set in GAMS on an NLP formulation. However, the GeneratedConstraintName() function does not work with the @NLconstraint object. Is there any other way to see how equations are named in GAMS?

renkekuhlmann commented 1 year ago

Sorry for not replying for so long. I was on parental leave for some time and just started working again. I was not aware of this issue with nonlinear constraints and will look into it. Thanks for reporting!

odow commented 1 year ago

JuMP's @NL nonlinear constraints do not really support names.

This limitation is fixed in the upcoming nonlinear rewrite: https://github.com/jump-dev/JuMP.jl/pull/3106

renkekuhlmann commented 1 year ago

Thanks @odow for pointing this out!

renkekuhlmann commented 6 months ago

With v0.5.0 GAMS.jl supports MOI.ScalarNonlinearFunction which in turn supports names. For those nonlinear constraints GeneratedConstraintName will work. Thanks for your patience!