relax some LM unit tests

This commit is contained in:
Gael Guennebaud
2014-09-02 17:10:17 +02:00
parent 42e27d41a2
commit ff9bfc45f7
2 changed files with 33 additions and 28 deletions

View File

@@ -1262,8 +1262,8 @@ void testNistBoxBOD(void)
// check return value
VERIFY_IS_EQUAL(info, 1);
VERIFY_IS_EQUAL(lm.nfev, 31);
VERIFY_IS_EQUAL(lm.njev, 25);
VERIFY(lm.nfev < 31); // 31
VERIFY(lm.njev < 25); // 25
// check norm^2
VERIFY_IS_APPROX(lm.fvec.squaredNorm(), 1.1680088766E+03);
// check x
@@ -1342,10 +1342,6 @@ void testNistMGH17(void)
lm.parameters.maxfev = 1000;
info = lm.minimize(x);
// check return value
VERIFY_IS_EQUAL(info, 2);
VERIFY_IS_EQUAL(lm.nfev, 602 );
VERIFY_IS_EQUAL(lm.njev, 545 );
// check norm^2
VERIFY_IS_APPROX(lm.fvec.squaredNorm(), 5.4648946975E-05);
// check x
@@ -1354,6 +1350,11 @@ void testNistMGH17(void)
VERIFY_IS_APPROX(x[2], -1.4646871366E+00);
VERIFY_IS_APPROX(x[3], 1.2867534640E-02);
VERIFY_IS_APPROX(x[4], 2.2122699662E-02);
// check return value
VERIFY_IS_EQUAL(info, 2);
VERIFY(lm.nfev < 650); // 602
VERIFY(lm.njev < 600); // 545
/*
* Second try
@@ -1832,8 +1833,8 @@ void test_NonLinearOptimization()
// NIST tests, level of difficulty = "Average"
CALL_SUBTEST/*_5*/(testNistHahn1());
CALL_SUBTEST/*_6*/(testNistMisra1d());
// CALL_SUBTEST/*_7*/(testNistMGH17());
// CALL_SUBTEST/*_8*/(testNistLanczos1());
CALL_SUBTEST/*_7*/(testNistMGH17());
CALL_SUBTEST/*_8*/(testNistLanczos1());
// // NIST tests, level of difficulty = "Higher"
CALL_SUBTEST/*_9*/(testNistRat42());