From 91ed6b07443c7f696fbf7483e754cee435b25d03 Mon Sep 17 00:00:00 2001 From: Elias Pipping <elias.pipping@fu-berlin.de> Date: Mon, 12 Sep 2011 20:56:13 +0200 Subject: [PATCH] Compare minima for the sample function --- src/test-gradient-method.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/test-gradient-method.cc b/src/test-gradient-method.cc index 62853a1d..d65bde2f 100644 --- a/src/test-gradient-method.cc +++ b/src/test-gradient-method.cc @@ -60,7 +60,13 @@ void testSampleFunction() { error -= returned; assert(error.two_norm() < 1e-10); // FIXME: 1e-10 sounds reasonable. Is it? - functionTester(J, start, 6); + double const ret1 = functionTester(J, start, 6); + + start[0] = 279; + start[1] = -96; + + double const ret2 = functionTester(J, start, 10); + assert(std::abs(ret1 - ret2) < 1e-5); } void testSampleFunctionNonsmooth() { -- GitLab