merge both c methods lmdif/lmdif1 into one class

LevenbergMarquardtNumericalDiff with two methods.
This commit is contained in:
Thomas Capricelli
2009-08-25 14:09:19 +02:00
parent a736378331
commit 3f1b81e129
4 changed files with 89 additions and 53 deletions

View File

@@ -541,7 +541,9 @@ void testLmdif1()
x.setConstant(n, 1.);
// do the computation
info = ei_lmdif1(lmdif_functor(), x, fvec);
lmdif_functor functor;
LevenbergMarquardtNumericalDiff<lmdif_functor,double> lm(functor);
info = lm.minimize(x, fvec);
// check return value
VERIFY( 1 == info);
@@ -569,7 +571,9 @@ void testLmdif()
x.setConstant(n, 1.);
// do the computation
info = ei_lmdif(lmdif_functor(), x, fvec, nfev, fjac, ipvt, qtf, diag);
lmdif_functor functor;
LevenbergMarquardtNumericalDiff<lmdif_functor,double> lm(functor);
info = lm.minimize(x, fvec, nfev, fjac, ipvt, qtf, diag);
// check return values
VERIFY( 1 == info);