This bugzilla service is closed. All entries have been migrated to
Bug 1160 - LM Module Unit Test Failure: test in testNistMGH10 incorrect
Summary: LM Module Unit Test Failure: test in testNistMGH10 incorrect
Alias: None
Product: Eigen
Classification: Unclassified
Component: Unsupported modules (show other bugs)
Version: 3.3 (current stable)
Hardware: All All
: Normal Failed Unit Test
Assignee: Nobody
: 1198 (view as bug list)
Depends on:
Reported: 2016-01-29 17:29 UTC by Sean
Modified: 2019-12-04 15:24 UTC (History)
5 users (show)

Test #653: levenberg_marquardt failed (93.91 KB, text/plain)
2016-04-15 12:44 UTC, Jaroslav Fojtik
no flags Details

Description Sean 2016-01-29 17:29:47 UTC
Within the testNistMGH10() test function in test/levenberg_marquardt.cpp, the following code is incorrect (currently lines 787-792 in c35c53729):

  x<< 2., 400000., 25000.;
  // do the computation
  MGH10_functor functor;
  LevenbergMarquardt<MGH10_functor> lm(functor);
  info = lm.minimize(x);
  VERIFY_IS_EQUAL(info, LevenbergMarquardtSpace::RelativeErrorTooSmall);

The last line should, I believe, be

  VERIFY_IS_EQUAL(info, LevenbergMarquardtSpace::RelativeReductionTooSmall);

which would match the original unit test code that read

  VERIFY_IS_EQUAL(info, 1);

(That line is still in the source but commented out @ line 802.)
Comment 1 Gael Guennebaud 2016-04-09 08:29:28 UTC
*** Bug 1198 has been marked as a duplicate of this bug. ***
Comment 2 Gael Guennebaud 2016-04-09 09:13:04 UTC
Summary: Bug 1160: fix and relax some lm unit tests by turning faillures to warnings
Comment 3 Christoph Hertzberg 2016-04-11 09:33:53 UTC
This appears to still fail when compiled with AVX (or FMA):

This is perhaps caused by slightly different results in computing the norms of vectors (i.e., the order of addition is not exactly the same).
Generally, I think we should avoid hard-coded unit-tests.
Comment 4 Gael Guennebaud 2016-04-13 12:43:07 UTC
yes, we should turn all tests like:

test_is_equal(info, LevenbergMarquardtSpace::RelativeReductionTooSmall)


VERIFY_IS_EQUAL(lm.nfev(), 79);

into warning and relax the hard checks so that we don't miss obvious regressions, but I don't have time to update them all...
Comment 5 Jaroslav Fojtik 2016-04-15 12:44:22 UTC
Created attachment 698 [details]
Test #653: levenberg_marquardt failed

I am facing a same issue, see attached file.
Comment 6 Nobody 2019-12-04 15:24:19 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance:

Note You need to log in before you can comment on or make changes to this bug.