stevengj / nlopt

library for nonlinear optimization, wrapping many algorithms for global and local, constrained or unconstrained, optimization
Other
1.86k stars 575 forks source link

Restriction on the number of equality constraints #357

Open tkx68 opened 4 years ago

tkx68 commented 4 years ago

The NLopt optimizer returns NLOPT_INVALID_ARGS if you give more than n equality constraints in a problem with n variables. This is totally reasonable in linear settings but not necessarily in nonlinear problems. As far as I can see e.g. ISRES does not depend on this. Could we lift this restriction and maybe just offer a warning with the result?

This feature/restriction was introduced in 2010 as can be seen in the NEWS file.

The problem arises in the functions nlopt_add_equality_mconstraint and nlopt_add_precond_equality_constraint in the file options.c where nlopt_count_constraints is called.

stevengj commented 4 years ago

Yes, I think it is fine to remove this check and just expect people to know what they are doing.

m-zanichelli commented 1 year ago

Hi, any updates on this?