chiark
/
gitweb
/
~ianmdlvl
/
nlopt.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4a63ac8
)
prepare to handle forced-stop in ORIG_DIRECT (not done yet)
author
stevenj
<stevenj@alum.mit.edu>
Sat, 10 Jul 2010 21:59:37 +0000
(17:59 -0400)
committer
stevenj
<stevenj@alum.mit.edu>
Sat, 10 Jul 2010 21:59:37 +0000
(17:59 -0400)
darcs-hash:
20100710215937
-c8de0-
b67e75ac8c2281b62aff33d86556069b4dc33c95
.gz
api/optimize.c
patch
|
blob
|
history
diff --git
a/api/optimize.c
b/api/optimize.c
index 52f443345f11ade43ec7ef9b257ca1225b0e0b76..b82cdf47b0c328c3b9aea9da03d127113f33acba 100644
(file)
--- a/
api/optimize.c
+++ b/
api/optimize.c
@@
-92,8
+92,10
@@
static double f_direct(int n, const double *x, int *undefined, void *data_)
unsigned i, j;
f = data->f((unsigned) n, x, NULL, data->f_data);
*undefined = isnan(f) || nlopt_isinf(f);
+ if (nlopt_get_force_stop(data)) return f;
for (i = 0; i < data->m && !*undefined; ++i) {
nlopt_eval_constraint(data->work, NULL, data->fc+i, (unsigned) n, x);
+ if (nlopt_get_force_stop(data)) return f;
for (j = 0; j < data->fc[i].m; ++j)
if (data->work[j] > 0)
*undefined = 1;