Felipe Olmos <felipe@...> writes:
> I am running nlopt 2.4.1. on C, using the NLOPT_AUGLAG algorithm with
NLOPT_LD_CCSAQ subsidiary algorithm.
> I set the maximum function evaluations to the AUGLAG nlopt optimizator and
my program does stop with this criterium (the return code does says that).
>
>
> Yet the "argmax" variable is not set to the current guess or "rough
optimum" as described in the documentation.
>
I figured out a workaround for this issue. Line 270 of auglag/auglag.c reads:
if (nlopt_stop_forced(stop)) {ret = NLOPT_FORCED_STOP; break;}
if (nlopt_stop_evals(stop)) {ret = NLOPT_MAXEVAL_REACHED;}
if (nlopt_stop_time(stop)) {ret = NLOPT_MAXTIME_REACHED; break;}
I just added a memcpy from the current estimate to the result:
if (nlopt_stop_forced(stop)) {ret = NLOPT_FORCED_STOP; break;}
if (nlopt_stop_evals(stop)) {
ret = NLOPT_MAXEVAL_REACHED;
memcpy(x, xcur, sizeof(double) * n);
break;
}
if (nlopt_stop_time(stop)) {ret = NLOPT_MAXTIME_REACHED; break;}
I think this can be done for the other stopping criteria but I wanted to
minimize the changes in the code.
Best Regards
Felipe
_______________________________________________
NLopt-discuss mailing list
[email protected]
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/nlopt-discuss