From: stevenj Date: Sun, 2 Sep 2007 02:10:52 +0000 (-0400) Subject: whoops, fix gradient X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=f56cdc48c8b9598b902f591af2297f9b8a99939d;p=nlopt.git whoops, fix gradient darcs-hash:20070902021052-c8de0-a9be63facbd050d1e2a61a62cce45c0175fca451.gz --- diff --git a/test/testfuncs.c b/test/testfuncs.c index 06856f9..cff3097 100644 --- a/test/testfuncs.c +++ b/test/testfuncs.c @@ -362,7 +362,7 @@ static double osc1d_f(int n, const double *x, double *grad, void *data) { double y = *x - 1.23456789; UNUSED(data); - if (grad) grad[0] = y*0.02 - sin(y - 2*sin(3*y)) * (1 - 6*cos(3*y)); + if (grad) grad[0] = y*0.02 + sin(y - 2*sin(3*y)) * (1 - 6*cos(3*y)); RETURN(sqr(y*0.1) - cos(y - 2*sin(3*y))); }