mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-06-20 22:52:51 +08:00
fix BoxBOD in the first case : now all tests pass
This commit is contained in:
parent
3856c2d84d
commit
3f63d6f97f
@ -1372,28 +1372,23 @@ void testNistBoxBOD(void)
|
|||||||
Eigen::MatrixXd fjac;
|
Eigen::MatrixXd fjac;
|
||||||
VectorXi ipvt;
|
VectorXi ipvt;
|
||||||
|
|
||||||
#if 0
|
|
||||||
/*
|
/*
|
||||||
* First try
|
* First try
|
||||||
*/
|
*/
|
||||||
x<< 1., 1.;
|
x<< 1., 1.;
|
||||||
// do the computation
|
// do the computation
|
||||||
info = ei_lmder<BoxBOD_functor, double>(x, fvec, nfev, njev, fjac, ipvt, diag);
|
info = ei_lmder<BoxBOD_functor, double>(x, fvec, nfev, njev, fjac, ipvt, diag,
|
||||||
1, 100., 14000, Eigen::machine_epsilon<double>(), Eigen::machine_epsilon<double>());
|
1, 10., 400, 1E6*Eigen::machine_epsilon<double>(), 1E6*Eigen::machine_epsilon<double>());
|
||||||
|
|
||||||
// check return value
|
// check return value
|
||||||
printf("info=%d, f,j: %d, %d\n", info, nfev, njev);
|
|
||||||
printf("norm2 = %.50g\n", fvec.squaredNorm());
|
|
||||||
std::cout << x << std::endl;
|
|
||||||
VERIFY( 1 == info);
|
VERIFY( 1 == info);
|
||||||
VERIFY( 10 == nfev);
|
VERIFY( 31 == nfev);
|
||||||
VERIFY( 6 == njev);
|
VERIFY( 25 == njev);
|
||||||
// check norm^2
|
// check norm^2
|
||||||
VERIFY_IS_APPROX(fvec.squaredNorm(), 1.1680088766E+03);
|
VERIFY_IS_APPROX(fvec.squaredNorm(), 1.1680088766E+03);
|
||||||
// check x
|
// check x
|
||||||
VERIFY_IS_APPROX(x[0], 2.1380940889E+02);
|
VERIFY_IS_APPROX(x[0], 2.1380940889E+02);
|
||||||
VERIFY_IS_APPROX(x[1], 5.4723748542E-01);
|
VERIFY_IS_APPROX(x[1], 5.4723748542E-01);
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Second try
|
* Second try
|
||||||
|
Loading…
x
Reference in New Issue
Block a user