From: stevenj Date: Fri, 24 Aug 2007 02:53:47 +0000 (-0400) Subject: whoops X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=30b2503cf9f8e04035830531dd65ad4c1b83168b;p=nlopt.git whoops darcs-hash:20070824025347-c8de0-c995e338829c25db49e5b822ed1563ebdd97eadf.gz --- 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':