/* | Lipschitz continues. However, DIRECT has proven to be effective on | */
/* | more complex problems than these. | */
/* +-----------------------------------------------------------------------+ */
-/* Subroutine */ void direct_direct_(fp fcn, doublereal *x, integer *n, doublereal *eps, doublereal epsabs, integer *maxf, integer *maxt, doublereal *minf, doublereal *l,
+/* Subroutine */ void direct_direct_(fp fcn, doublereal *x, integer *n, doublereal *eps, doublereal epsabs, integer *maxf, integer *maxt, double starttime, double maxtime, int *force_stop, doublereal *minf, doublereal *l,
doublereal *u, integer *algmethod, integer *ierror, FILE *logfile,
doublereal *fglobal, doublereal *fglper, doublereal *volper,
doublereal *sigmaper, void *fcn_data)
direct_dirinit_(f, fcn, c__, length, &actdeep, point, anchor, &ifree,
logfile, arrayi, &maxi, list2, w, &x[1], &l[1], &u[1],
minf, &minpos, thirds, levels, &MAXFUNC, &MAXDEEP, n, n, &
- fmax, &ifeasiblef, &iinfesiblef, ierror, fcn_data, jones);
+ fmax, &ifeasiblef, &iinfesiblef, ierror, fcn_data, jones,
+ starttime, maxtime, force_stop);
/* +-----------------------------------------------------------------------+ */
/* | Added error checking. | */
/* +-----------------------------------------------------------------------+ */
fprintf(logfile, "WARNING: Error occured in routine DIRsamplef..\n");
goto cleanup;
}
+ if (*ierror == -102) goto L100;
}
+ else if (*ierror == DIRECT_MAXTIME_EXCEEDED) goto L100;
numfunc = maxi + 1 + maxi;
actmaxdeep = 1;
oldpos = 0;
logfile, f, &ifree, &maxi, point, fcn, &x[
1], &l[1], minf, &minpos, &u[1], n, &MAXFUNC, &
MAXDEEP, &oops, &fmax, &ifeasiblef, &iinfesiblef,
- fcn_data);
+ fcn_data, force_stop);
+ if (force_stop && *force_stop) {
+ *ierror = -102;
+ goto L100;
+ }
+ if (nlopt_stop_time_(starttime, maxtime)) {
+ *ierror = DIRECT_MAXTIME_EXCEEDED;
+ goto L100;
+ }
if (oops > 0) {
if (logfile)
fprintf(logfile, "WARNING: Error occured in routine DIRsamplef.\n");