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:
cc7c2f8
)
relax floating point comparison, missing free
author
Julien Schueller
<schueller@phimeca.com>
Thu, 24 Aug 2017 08:36:57 +0000
(10:36 +0200)
committer
Julien Schueller
<schueller@phimeca.com>
Thu, 24 Aug 2017 08:36:57 +0000
(10:36 +0200)
test/testopt.c
patch
|
blob
|
history
diff --git
a/test/testopt.c
b/test/testopt.c
index fa69dca7b2875cdd56f80df49bac5546a19a7cd1..147882cc4bcddd673343c60e2a3a62eaee154352 100644
(file)
--- a/
test/testopt.c
+++ b/
test/testopt.c
@@
-176,6
+176,7
@@
static int test_function(int ifunc)
fprintf(stderr, ") = %0.16g instead of %0.16g, |diff| = %g\n",
func.f(func.n, func.xmin, 0, func.f_data), func.minf,
fabs(func.f(func.n, func.xmin, 0, func.f_data) - func.minf));
+ free(x);
return 0;
}
@@
-252,7
+253,7
@@
static int test_function(int ifunc)
printf("]\n");
val = func.f(func.n, x, NULL, func.f_data);
- if (
val != minf
) {
+ if (
fabs(val - minf) > 1e-12
) {
fprintf(stderr, "Mismatch %g between returned minf=%g and f(x) = %g\n",
minf - val, minf, val);
free(x);