mirror of
https://gitlab.com/libeigen/eigen.git
synced 2024-12-21 07:19:46 +08:00
cleaning
This commit is contained in:
parent
4e62e29869
commit
6f567f10be
@ -66,11 +66,11 @@ void testChkder()
|
||||
/* checking the jacobian matrix. */
|
||||
x << 9.2e-1, 1.3e-1, 5.4e-1;
|
||||
|
||||
ei_chkder<double>(x, fvec, fjac, xp, fvecp, 1, err);
|
||||
ei_chkder(x, fvec, fjac, xp, fvecp, 1, err);
|
||||
fcn_chkder(m, n, x.data(), fvec.data(), fjac.data(), m, 1);
|
||||
fcn_chkder(m, n, x.data(), fvec.data(), fjac.data(), m, 2);
|
||||
fcn_chkder(m, n, xp.data(), fvecp.data(), fjac.data(), m, 1);
|
||||
ei_chkder<double>(x, fvec, fjac, xp, fvecp, 2, err);
|
||||
ei_chkder(x, fvec, fjac, xp, fvecp, 2, err);
|
||||
|
||||
fvecp -= fvec;
|
||||
|
||||
@ -148,7 +148,7 @@ void testLmder1()
|
||||
x.setConstant(n, 1.);
|
||||
|
||||
// do the computation
|
||||
info = ei_lmder1<lmder_functor,double>(x, fvec, ipvt);
|
||||
info = ei_lmder1<lmder_functor>(x, fvec, ipvt);
|
||||
|
||||
// check return value
|
||||
VERIFY( 1 == info);
|
||||
@ -175,7 +175,7 @@ void testLmder()
|
||||
x.setConstant(n, 1.);
|
||||
|
||||
// do the computation
|
||||
info = ei_lmder<lmder_functor, double>(x, fvec, nfev, njev, fjac, ipvt, qtf, diag);
|
||||
info = ei_lmder<lmder_functor>(x, fvec, nfev, njev, fjac, ipvt, qtf, diag);
|
||||
|
||||
// check return values
|
||||
VERIFY( 1 == info);
|
||||
@ -193,7 +193,7 @@ void testLmder()
|
||||
|
||||
// check covariance
|
||||
covfac = fnorm*fnorm/(m-n);
|
||||
ei_covar<double>(fjac, ipvt);
|
||||
ei_covar(fjac, ipvt);
|
||||
|
||||
MatrixXd cov_ref(n,n);
|
||||
cov_ref <<
|
||||
@ -258,7 +258,7 @@ void testHybrj1()
|
||||
x.setConstant(n, -1.);
|
||||
|
||||
// do the computation
|
||||
info = ei_hybrj1<hybrj_functor, double>(x,fvec, fjac);
|
||||
info = ei_hybrj1<hybrj_functor>(x,fvec, fjac);
|
||||
|
||||
// check return value
|
||||
VERIFY( 1 == info);
|
||||
@ -290,7 +290,7 @@ void testHybrj()
|
||||
diag.setConstant(n, 1.);
|
||||
|
||||
// do the computation
|
||||
info = ei_hybrj<hybrj_functor, double>(x,fvec, nfev, njev, fjac, R, qtf, diag, mode);
|
||||
info = ei_hybrj<hybrj_functor>(x,fvec, nfev, njev, fjac, R, qtf, diag, mode);
|
||||
|
||||
// check return value
|
||||
VERIFY( 1 == info);
|
||||
@ -341,7 +341,7 @@ void testHybrd1()
|
||||
x.setConstant(n, -1.);
|
||||
|
||||
// do the computation
|
||||
info = ei_hybrd1<hybrd_functor,double>(x, fvec);
|
||||
info = ei_hybrd1<hybrd_functor>(x, fvec);
|
||||
|
||||
// check return value
|
||||
VERIFY( 1 == info);
|
||||
@ -371,7 +371,7 @@ void testHybrd()
|
||||
diag.setConstant(n, 1.);
|
||||
|
||||
// do the computation
|
||||
info = ei_hybrd<hybrd_functor, double>(x,fvec, nfev, fjac, R, qtf, diag, mode, ml, mu);
|
||||
info = ei_hybrd<hybrd_functor>(x,fvec, nfev, fjac, R, qtf, diag, mode, ml, mu);
|
||||
|
||||
// check return value
|
||||
VERIFY( 1 == info);
|
||||
@ -439,7 +439,7 @@ void testLmstr1()
|
||||
x.setConstant(n, 1.);
|
||||
|
||||
// do the computation
|
||||
info = ei_lmstr1<lmstr_functor,double>(x, fvec, ipvt);
|
||||
info = ei_lmstr1<lmstr_functor>(x, fvec, ipvt);
|
||||
|
||||
// check return value
|
||||
VERIFY( 1 == info);
|
||||
@ -466,7 +466,7 @@ void testLmstr()
|
||||
x.setConstant(n, 1.);
|
||||
|
||||
// do the computation
|
||||
info = ei_lmstr<lmstr_functor, double>(x, fvec, nfev, njev, fjac, ipvt, qtf, diag);
|
||||
info = ei_lmstr<lmstr_functor>(x, fvec, nfev, njev, fjac, ipvt, qtf, diag);
|
||||
VectorXd wa(n);
|
||||
|
||||
// check return values
|
||||
@ -521,7 +521,7 @@ void testLmdif1()
|
||||
x.setConstant(n, 1.);
|
||||
|
||||
// do the computation
|
||||
info = ei_lmdif1<lmdif_functor,double>(x, fvec);
|
||||
info = ei_lmdif1<lmdif_functor>(x, fvec);
|
||||
|
||||
// check return value
|
||||
VERIFY( 1 == info);
|
||||
@ -549,7 +549,7 @@ void testLmdif()
|
||||
x.setConstant(n, 1.);
|
||||
|
||||
// do the computation
|
||||
info = ei_lmdif<lmdif_functor, double>(x, fvec, nfev, fjac, ipvt, qtf, diag);
|
||||
info = ei_lmdif<lmdif_functor>(x, fvec, nfev, fjac, ipvt, qtf, diag);
|
||||
|
||||
// check return values
|
||||
VERIFY( 1 == info);
|
||||
@ -566,7 +566,7 @@ void testLmdif()
|
||||
|
||||
// check covariance
|
||||
covfac = fnorm*fnorm/(m-n);
|
||||
ei_covar<double>(fjac, ipvt);
|
||||
ei_covar(fjac, ipvt);
|
||||
|
||||
MatrixXd cov_ref(n,n);
|
||||
cov_ref <<
|
||||
@ -633,7 +633,7 @@ void testNistChwirut2(void)
|
||||
*/
|
||||
x<< 0.1, 0.01, 0.02;
|
||||
// do the computation
|
||||
info = ei_lmder<chwirut2_functor, double>(x, fvec, nfev, njev, fjac, ipvt, qtf, diag);
|
||||
info = ei_lmder<chwirut2_functor>(x, fvec, nfev, njev, fjac, ipvt, qtf, diag);
|
||||
|
||||
// check return value
|
||||
VERIFY( 1 == info);
|
||||
@ -651,7 +651,7 @@ void testNistChwirut2(void)
|
||||
*/
|
||||
x<< 0.15, 0.008, 0.010;
|
||||
// do the computation
|
||||
info = ei_lmder<chwirut2_functor, double>(x, fvec, nfev, njev, fjac, ipvt, qtf, diag,
|
||||
info = ei_lmder<chwirut2_functor>(x, fvec, nfev, njev, fjac, ipvt, qtf, diag,
|
||||
1, 100., 400, 1.E6*epsilon<double>(), 1.E6*epsilon<double>());
|
||||
|
||||
// check return value
|
||||
@ -710,7 +710,7 @@ void testNistMisra1a(void)
|
||||
*/
|
||||
x<< 500., 0.0001;
|
||||
// do the computation
|
||||
info = ei_lmder<misra1a_functor, double>(x, fvec, nfev, njev, fjac, ipvt, qtf, diag);
|
||||
info = ei_lmder<misra1a_functor>(x, fvec, nfev, njev, fjac, ipvt, qtf, diag);
|
||||
|
||||
// check return value
|
||||
VERIFY( 1 == info);
|
||||
@ -727,7 +727,7 @@ void testNistMisra1a(void)
|
||||
*/
|
||||
x<< 250., 0.0005;
|
||||
// do the computation
|
||||
info = ei_lmder<misra1a_functor, double>(x, fvec, nfev, njev, fjac, ipvt, qtf, diag);
|
||||
info = ei_lmder<misra1a_functor>(x, fvec, nfev, njev, fjac, ipvt, qtf, diag);
|
||||
|
||||
// check return value
|
||||
VERIFY( 1 == info);
|
||||
@ -795,7 +795,7 @@ void testNistHahn1(void)
|
||||
*/
|
||||
x<< 10., -1., .05, -.00001, -.05, .001, -.000001;
|
||||
// do the computation
|
||||
info = ei_lmder<hahn1_functor, double>(x, fvec, nfev, njev, fjac, ipvt, qtf, diag);
|
||||
info = ei_lmder<hahn1_functor>(x, fvec, nfev, njev, fjac, ipvt, qtf, diag);
|
||||
|
||||
// check return value
|
||||
VERIFY( 1 == info);
|
||||
@ -817,7 +817,7 @@ void testNistHahn1(void)
|
||||
*/
|
||||
x<< .1, -.1, .005, -.000001, -.005, .0001, -.0000001;
|
||||
// do the computation
|
||||
info = ei_lmder<hahn1_functor, double>(x, fvec, nfev, njev, fjac, ipvt, qtf, diag);
|
||||
info = ei_lmder<hahn1_functor>(x, fvec, nfev, njev, fjac, ipvt, qtf, diag);
|
||||
|
||||
// check return value
|
||||
VERIFY( 1 == info);
|
||||
@ -880,7 +880,7 @@ void testNistMisra1d(void)
|
||||
*/
|
||||
x<< 500., 0.0001;
|
||||
// do the computation
|
||||
info = ei_lmder<misra1d_functor, double>(x, fvec, nfev, njev, fjac, ipvt, qtf, diag);
|
||||
info = ei_lmder<misra1d_functor>(x, fvec, nfev, njev, fjac, ipvt, qtf, diag);
|
||||
|
||||
// check return value
|
||||
VERIFY( 3 == info);
|
||||
@ -897,7 +897,7 @@ void testNistMisra1d(void)
|
||||
*/
|
||||
x<< 450., 0.0003;
|
||||
// do the computation
|
||||
info = ei_lmder<misra1d_functor, double>(x, fvec, nfev, njev, fjac, ipvt, qtf, diag);
|
||||
info = ei_lmder<misra1d_functor>(x, fvec, nfev, njev, fjac, ipvt, qtf, diag);
|
||||
|
||||
// check return value
|
||||
VERIFY( 1 == info);
|
||||
@ -957,7 +957,7 @@ void testNistLanczos1(void)
|
||||
*/
|
||||
x<< 1.2, 0.3, 5.6, 5.5, 6.5, 7.6;
|
||||
// do the computation
|
||||
info = ei_lmder<lanczos1_functor, double>(x, fvec, nfev, njev, fjac, ipvt, qtf, diag);
|
||||
info = ei_lmder<lanczos1_functor>(x, fvec, nfev, njev, fjac, ipvt, qtf, diag);
|
||||
|
||||
// check return value
|
||||
VERIFY( 2 == info);
|
||||
@ -978,7 +978,7 @@ void testNistLanczos1(void)
|
||||
*/
|
||||
x<< 0.5, 0.7, 3.6, 4.2, 4., 6.3;
|
||||
// do the computation
|
||||
info = ei_lmder<lanczos1_functor, double>(x, fvec, nfev, njev, fjac, ipvt, qtf, diag);
|
||||
info = ei_lmder<lanczos1_functor>(x, fvec, nfev, njev, fjac, ipvt, qtf, diag);
|
||||
|
||||
// check return value
|
||||
VERIFY( 2 == info);
|
||||
@ -1042,7 +1042,7 @@ void testNistRat42(void)
|
||||
*/
|
||||
x<< 100., 1., 0.1;
|
||||
// do the computation
|
||||
info = ei_lmder<rat42_functor, double>(x, fvec, nfev, njev, fjac, ipvt, qtf, diag);
|
||||
info = ei_lmder<rat42_functor>(x, fvec, nfev, njev, fjac, ipvt, qtf, diag);
|
||||
|
||||
// check return value
|
||||
VERIFY( 1 == info);
|
||||
@ -1060,7 +1060,7 @@ void testNistRat42(void)
|
||||
*/
|
||||
x<< 75., 2.5, 0.07;
|
||||
// do the computation
|
||||
info = ei_lmder<rat42_functor, double>(x, fvec, nfev, njev, fjac, ipvt, qtf, diag);
|
||||
info = ei_lmder<rat42_functor>(x, fvec, nfev, njev, fjac, ipvt, qtf, diag);
|
||||
|
||||
// check return value
|
||||
VERIFY( 1 == info);
|
||||
@ -1119,7 +1119,7 @@ void testNistMGH10(void)
|
||||
*/
|
||||
x<< 2., 400000., 25000.;
|
||||
// do the computation
|
||||
info = ei_lmder<MGH10_functor, double>(x, fvec, nfev, njev, fjac, ipvt, qtf, diag);
|
||||
info = ei_lmder<MGH10_functor>(x, fvec, nfev, njev, fjac, ipvt, qtf, diag);
|
||||
|
||||
// check return value
|
||||
VERIFY( 2 == info);
|
||||
@ -1137,7 +1137,7 @@ void testNistMGH10(void)
|
||||
*/
|
||||
x<< 0.02, 4000., 250.;
|
||||
// do the computation
|
||||
info = ei_lmder<MGH10_functor, double>(x, fvec, nfev, njev, fjac, ipvt, qtf, diag);
|
||||
info = ei_lmder<MGH10_functor>(x, fvec, nfev, njev, fjac, ipvt, qtf, diag);
|
||||
|
||||
// check return value
|
||||
VERIFY( 2 == info);
|
||||
@ -1194,7 +1194,7 @@ void testNistBoxBOD(void)
|
||||
*/
|
||||
x<< 1., 1.;
|
||||
// do the computation
|
||||
info = ei_lmder<BoxBOD_functor, double>(x, fvec, nfev, njev, fjac, ipvt, qtf, diag,
|
||||
info = ei_lmder<BoxBOD_functor>(x, fvec, nfev, njev, fjac, ipvt, qtf, diag,
|
||||
1, 10., 400, 1E6*epsilon<double>(), 1E6*epsilon<double>());
|
||||
|
||||
// check return value
|
||||
@ -1212,7 +1212,7 @@ void testNistBoxBOD(void)
|
||||
*/
|
||||
x<< 100., 0.75;
|
||||
// do the computation
|
||||
info = ei_lmder<BoxBOD_functor, double>(x, fvec, nfev, njev, fjac, ipvt, qtf, diag,
|
||||
info = ei_lmder<BoxBOD_functor>(x, fvec, nfev, njev, fjac, ipvt, qtf, diag,
|
||||
1, 100., 14000, epsilon<double>(), epsilon<double>());
|
||||
|
||||
// check return value
|
||||
@ -1271,7 +1271,7 @@ void testNistMGH17(void)
|
||||
*/
|
||||
x<< 50., 150., -100., 1., 2.;
|
||||
// do the computation
|
||||
info = ei_lmder<MGH17_functor, double>(
|
||||
info = ei_lmder<MGH17_functor>(
|
||||
x, fvec, nfev, njev, fjac, ipvt, qtf, diag,
|
||||
1, 100., 5000, epsilon<double>(), epsilon<double>());
|
||||
|
||||
@ -1293,7 +1293,7 @@ void testNistMGH17(void)
|
||||
*/
|
||||
x<< 0.5 ,1.5 ,-1 ,0.01 ,0.02;
|
||||
// do the computation
|
||||
info = ei_lmder<MGH17_functor, double>(x, fvec, nfev, njev, fjac, ipvt, qtf, diag);
|
||||
info = ei_lmder<MGH17_functor>(x, fvec, nfev, njev, fjac, ipvt, qtf, diag);
|
||||
|
||||
// check return value
|
||||
VERIFY( 1 == info);
|
||||
@ -1357,9 +1357,8 @@ void testNistMGH09(void)
|
||||
*/
|
||||
x<< 25., 39, 41.5, 39.;
|
||||
// do the computation
|
||||
info = ei_lmder<MGH09_functor, double>(x, fvec, nfev, njev, fjac, ipvt, qtf, diag,
|
||||
info = ei_lmder<MGH09_functor>(x, fvec, nfev, njev, fjac, ipvt, qtf, diag,
|
||||
1, 100., 5000);
|
||||
// 1, 100., 5000, epsilon<double>(), epsilon<double>());
|
||||
|
||||
// check return value
|
||||
VERIFY( 1 == info);
|
||||
@ -1378,7 +1377,7 @@ void testNistMGH09(void)
|
||||
*/
|
||||
x<< 0.25, 0.39, 0.415, 0.39;
|
||||
// do the computation
|
||||
info = ei_lmder<MGH09_functor, double>(x, fvec, nfev, njev, fjac, ipvt, qtf, diag);
|
||||
info = ei_lmder<MGH09_functor>(x, fvec, nfev, njev, fjac, ipvt, qtf, diag);
|
||||
|
||||
// check return value
|
||||
VERIFY( 1 == info);
|
||||
@ -1439,7 +1438,7 @@ void testNistBennett5(void)
|
||||
*/
|
||||
x<< -2000., 50., 0.8;
|
||||
// do the computation
|
||||
info = ei_lmder<Bennett5_functor, double>(x, fvec, nfev, njev, fjac, ipvt, qtf, diag,
|
||||
info = ei_lmder<Bennett5_functor>(x, fvec, nfev, njev, fjac, ipvt, qtf, diag,
|
||||
1, 100., 5000);
|
||||
|
||||
// check return value
|
||||
@ -1457,7 +1456,7 @@ void testNistBennett5(void)
|
||||
*/
|
||||
x<< -1500., 45., 0.85;
|
||||
// do the computation
|
||||
info = ei_lmder<Bennett5_functor, double>(x, fvec, nfev, njev, fjac, ipvt, qtf, diag);
|
||||
info = ei_lmder<Bennett5_functor>(x, fvec, nfev, njev, fjac, ipvt, qtf, diag);
|
||||
|
||||
// check return value
|
||||
VERIFY( 1 == info);
|
||||
@ -1524,7 +1523,7 @@ void testNistThurber(void)
|
||||
*/
|
||||
x<< 1000 ,1000 ,400 ,40 ,0.7,0.3,0.0 ;
|
||||
// do the computation
|
||||
info = ei_lmder<thurber_functor, double>(x, fvec, nfev, njev, fjac, ipvt, qtf, diag,
|
||||
info = ei_lmder<thurber_functor>(x, fvec, nfev, njev, fjac, ipvt, qtf, diag,
|
||||
1, 100., 400, 1.E4*epsilon<double>(), 1.E4*epsilon<double>());
|
||||
|
||||
// check return value
|
||||
@ -1547,7 +1546,7 @@ void testNistThurber(void)
|
||||
*/
|
||||
x<< 1300 ,1500 ,500 ,75 ,1 ,0.4 ,0.05 ;
|
||||
// do the computation
|
||||
info = ei_lmder<thurber_functor, double>(x, fvec, nfev, njev, fjac, ipvt, qtf, diag,
|
||||
info = ei_lmder<thurber_functor>(x, fvec, nfev, njev, fjac, ipvt, qtf, diag,
|
||||
1, 100., 400, 1.E4*epsilon<double>(), 1.E4*epsilon<double>());
|
||||
|
||||
// check return value
|
||||
@ -1612,7 +1611,7 @@ void testNistRat43(void)
|
||||
*/
|
||||
x<< 100., 10., 1., 1.;
|
||||
// do the computation
|
||||
info = ei_lmder<rat43_functor, double>(x, fvec, nfev, njev, fjac, ipvt, qtf, diag,
|
||||
info = ei_lmder<rat43_functor>(x, fvec, nfev, njev, fjac, ipvt, qtf, diag,
|
||||
1, 100., 400, 1.E6*epsilon<double>(), 1.E6*epsilon<double>());
|
||||
|
||||
// check return value
|
||||
@ -1632,7 +1631,7 @@ void testNistRat43(void)
|
||||
*/
|
||||
x<< 700., 5., 0.75, 1.3;
|
||||
// do the computation
|
||||
info = ei_lmder<rat43_functor, double>(x, fvec, nfev, njev, fjac, ipvt, qtf, diag,
|
||||
info = ei_lmder<rat43_functor>(x, fvec, nfev, njev, fjac, ipvt, qtf, diag,
|
||||
1, 100., 400, 1.E5*epsilon<double>(), 1.E5*epsilon<double>());
|
||||
|
||||
// check return value
|
||||
@ -1695,7 +1694,7 @@ void testNistEckerle4(void)
|
||||
*/
|
||||
x<< 1., 10., 500.;
|
||||
// do the computation
|
||||
info = ei_lmder<eckerle4_functor, double>(x, fvec, nfev, njev, fjac, ipvt, qtf, diag);
|
||||
info = ei_lmder<eckerle4_functor>(x, fvec, nfev, njev, fjac, ipvt, qtf, diag);
|
||||
|
||||
// check return value
|
||||
VERIFY( 1 == info);
|
||||
@ -1713,7 +1712,7 @@ void testNistEckerle4(void)
|
||||
*/
|
||||
x<< 1.5, 5., 450.;
|
||||
// do the computation
|
||||
info = ei_lmder<eckerle4_functor, double>(x, fvec, nfev, njev, fjac, ipvt, qtf, diag);
|
||||
info = ei_lmder<eckerle4_functor>(x, fvec, nfev, njev, fjac, ipvt, qtf, diag);
|
||||
|
||||
// check return value
|
||||
VERIFY( 1 == info);
|
||||
|
Loading…
Reference in New Issue
Block a user