From 30b2503cf9f8e04035830531dd65ad4c1b83168b Mon Sep 17 00:00:00 2001 From: stevenj Date: Thu, 23 Aug 2007 22:53:47 -0400 Subject: [PATCH] whoops darcs-hash:20070824025347-c8de0-c995e338829c25db49e5b822ed1563ebdd97eadf.gz --- api/nlopt.c | 2 +- test/testopt.cpp | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/api/nlopt.c b/api/nlopt.c index ef3acf9..5de5282 100644 --- a/api/nlopt.c +++ b/api/nlopt.c @@ -135,7 +135,7 @@ nlopt_result nlopt_minimize( } iret = lbfgsb_minimize(n, f, f_data, x, nbd, lb, ub, MIN(n, 5), 0.0, ftol_rel, - xtol_abs ? xtol_rel : *xtol_abs, + xtol_abs ? *xtol_abs : xtol_rel, maxeval); free(nbd); if (iret <= 0) { diff --git a/test/testopt.cpp b/test/testopt.cpp index 3599f51..795a39c 100644 --- a/test/testopt.cpp +++ b/test/testopt.cpp @@ -125,6 +125,9 @@ int main(int argc, char **argv) srand((unsigned) time(NULL)); testfuncs_verbose = 0; + if (argc <= 1) + usage(stdout); + while ((c = getopt(argc, argv, "hvra:o:e:")) != -1) switch (c) { case 'h': -- GitLab