nlopt icon indicating copy to clipboard operation
nlopt copied to clipboard

Back away from inequality constraints that evaluate to NaN

Open jpritikin opened this issue 10 years ago • 9 comments

This permits slsqp to deal with the interaction between inequality constraints and soft feasibility constraints.

jpritikin avatar May 04 '15 13:05 jpritikin

Oops, this change is not passing all of my tests yet.

jpritikin avatar May 04 '15 14:05 jpritikin

Actually these changes are good. The problem I was having was caused by use of ftol instead of xtol on a constrained problem.

jpritikin avatar May 04 '15 16:05 jpritikin

How does this look?

jpritikin avatar May 08 '15 19:05 jpritikin

Hm, do I need to save/restore slsqpb_state if I pick a point from the line search that is not the last point?

jpritikin avatar May 09 '15 15:05 jpritikin

@jpritikin, regarding the SAVE/RESTORE_STATE: if I remember correctly, the original Fortran code was using the equivalent of static C local variables for these things, and I wanted it to be re-entrant & thread-safe. So, the state only needs saving inside the slsqpb_, and should be saved at every exit point from that function (unless you will never come back, e.g. you are exiting because you have converged or there was an error).

stevengj avatar May 12 '15 16:05 stevengj

Could you squash these (via git rebase --interactive followed by a git push -f) into a single commit? Also be sure to put (for #30) in the commit message so that #30 will be cross-referenced.

stevengj avatar May 12 '15 16:05 stevengj

regarding the SAVE/RESTORE_STATE

This question was addressed with https://github.com/jpritikin/nlopt/commit/356bd27e08bbd20abb07534b6678257492ec8421

jpritikin avatar May 12 '15 16:05 jpritikin

Should the s[i__] = x[i__] - x0[i__]; loop be executed every time we goto L260, or only from the beginning of the slsqpb_ function? Maybe you should move it before the relevant goto.

stevengj avatar May 12 '15 18:05 stevengj

Should the s[i__] = x[i__] - x0[i__]; loop be executed every time we goto L260, or only from the beginning of the slsqpb_ function?

Sorry, I can't remember. Certainly the code doesn't hurt. It helps preserve an invariant condition that should be preserved.

jpritikin avatar Nov 14 '20 00:11 jpritikin