#include "cdirect.h"
-#ifdef WITH_NOCEDAL
-# include "l-bfgs-b.h"
-#endif
-
#include "luksan.h"
#include "crs.h"
step, ni, x, f_bound, opt, &stop, minf);
}
-#ifdef WITH_NOCEDAL
- case NLOPT_LD_LBFGS_NOCEDAL: {
- int iret, *nbd = (int *) malloc(sizeof(int) * n);
- if (!nbd) return NLOPT_OUT_OF_MEMORY;
- for (i = 0; i < n; ++i) {
- int linf = nlopt_isinf(lb[i]) && lb[i] < 0;
- int uinf = nlopt_isinf(ub[i]) && ub[i] > 0;
- nbd[i] = linf && uinf ? 0 : (uinf ? 1 : (linf ? 3 : 2));
- }
- iret = lbfgsb_minimize(ni, f, f_data, x, nbd, lb, ub,
- ni < 5 ? ni : 5, 0.0, stop.ftol_rel,
- stop.xtol_abs[0] > 0 ? stop.xtol_abs[0]
- : stop.xtol_rel,
- stop.maxeval);
- free(nbd);
- if (iret <= 0) {
- switch (iret) {
- case -1: return NLOPT_INVALID_ARGS;
- case -2: default: return NLOPT_FAILURE;
- }
- }
- else {
- *minf = f(n, x, NULL, f_data);
- switch (iret) {
- case 5: return NLOPT_MAXEVAL_REACHED;
- case 2: return NLOPT_XTOL_REACHED;
- case 1: return NLOPT_FTOL_REACHED;
- default: return NLOPT_SUCCESS;
- }
- }
- break;
- }
-#endif
-
case NLOPT_LD_LBFGS:
return luksan_plis(ni, f, f_data, lb, ub, x, minf,
&stop, opt->vector_storage);