提交 f56cdc48 编写于 作者: S stevenj

whoops, fix gradient

darcs-hash:20070902021052-c8de0-a9be63facbd050d1e2a61a62cce45c0175fca451.gz
上级 a75f93ba
......@@ -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)));
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册