stevengj / nlopt

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

NLOPT-2.4.2, iterm = -6 in luksan_plis routine in luksan/plis.c #115

Open DeanLym opened 7 years ago

DeanLym commented 7 years ago

An "nlopt failure" exception is sometimes raised for one of my optimization problem.

I found out the following post about the issue. http://thread.gmane.org/gmane.science.analysis.nlopt.general/274

I did the same as suggested in the post, and it also turns out to be "iterm=-6" for my case.

The optimal solutions are fine if I ignore the exception.

Why is "iterm=-6" in luksan_plis routine in luksan/plis.c deemed nlopt failure?

stevengj commented 6 years ago

According to the PLIS source code, iterm < 0 indicates that "the method failed". I don't know how reliable it would be to assume that the result is still okay...

jschueller commented 4 years ago

hi @DeanLym, in the doc they talk about return code 6, but I dont see how it can be positive here, there's clearly a mismatch between the code and the doc.

/*     STEEPEST DESCENT DIRECTION */

        luksan_mxuneg__(nf, &gf[1], &s[1], &ix[1], &kbf);
        snorm = gnorm;
        if (kit < stat_1->nit) {
            ++stat_1->nres;
            kit = stat_1->nit;
        } else {
             *iterm = -10;
            if (iters < 0) {

                *iterm = iters - 5;
            }
        }
    }

the error codes are set in luksan_pyfut1__