jump-dev / JuMP.jl

Modeling language for Mathematical Optimization (linear, mixed-integer, conic, semidefinite, nonlinear)
http://jump.dev/JuMP.jl/
Other
2.19k stars 390 forks source link

Provide support for @addNLConstraints #332

Closed yeesian closed 9 years ago

yeesian commented 9 years ago

Currently we can add groups of (affine) constraints through the @addConstraints macro, e.g.

@addConstraints m begin
  x >= 1
  y - w <= 2
  sum_to_one[i=1:3], z[i] + y == 1
end

It will be great to extend it to nonlinear constraints, by introducing a @addNLConstraints macro. This will be useful for problem instances such as the MINLP example in KNITRO.

joehuchette commented 9 years ago

This would be nice to have. @addConstraints works as a simple wrapper around @addConstraint, and I'm guessing @addNLConstraints could be implemented with pretty much the exact same strategy (and code).

mlubin commented 9 years ago

Yeah, should be a copy-paste job.