remove the boring, old-school nprint option, we'll have a dedicated

method for 'one iteration' anyway.
This commit is contained in:
Thomas Capricelli 2009-08-25 17:11:14 +02:00
parent 613a464320
commit 858acfcc64
5 changed files with 10 additions and 78 deletions

View File

@ -20,8 +20,7 @@ public:
const int maxfev = 2000,
const Scalar factor = Scalar(100.),
const Scalar xtol = ei_sqrt(epsilon<Scalar>()),
const Scalar epsfcn = Scalar(0.),
const int nprint=0
const Scalar epsfcn = Scalar(0.)
);
Matrix< Scalar, Dynamic, 1 > fvec;
@ -76,8 +75,7 @@ int HybridNonLinearSolverNumericalDiff<FunctorType,Scalar>::solve(
const int maxfev,
const Scalar factor,
const Scalar xtol,
const Scalar epsfcn,
const int nprint
const Scalar epsfcn
)
{
const int n = x.size();
@ -225,15 +223,6 @@ int HybridNonLinearSolverNumericalDiff<FunctorType,Scalar>::solve(
/* beginning of the inner loop. */
while (true) {
/* if requested, call functor.f to enable printing of iterates. */
if (nprint > 0) {
iflag = 0;
if ((iter - 1) % nprint == 0)
iflag = functor.debug(x, fvec);
if (iflag < 0)
goto algo_end;
}
/* determine the direction p. */
@ -380,8 +369,6 @@ algo_end:
/* termination, either normal or user imposed. */
if (iflag < 0)
info = iflag;
if (nprint > 0)
iflag = functor.debug(x, fvec);
return info;
}

View File

@ -17,8 +17,7 @@ public:
const int mode=1,
const int maxfev = 1000,
const Scalar factor = Scalar(100.),
const Scalar xtol = ei_sqrt(epsilon<Scalar>()),
const int nprint=0
const Scalar xtol = ei_sqrt(epsilon<Scalar>())
);
Matrix< Scalar, Dynamic, 1 > fvec;
@ -71,8 +70,7 @@ int HybridNonLinearSolver<FunctorType,Scalar>::solve(
const int mode,
const int maxfev,
const Scalar factor,
const Scalar xtol,
const int nprint
const Scalar xtol
)
{
const int n = x.size();
@ -211,15 +209,6 @@ int HybridNonLinearSolver<FunctorType,Scalar>::solve(
/* beginning of the inner loop. */
while (true) {
/* if requested, call functor.f to enable printing of iterates. */
if (nprint > 0) {
iflag = 0;
if ((iter - 1) % nprint == 0)
iflag = functor.debug(x, fvec, fjac);
if (iflag < 0)
goto algo_end;
}
/* determine the direction p. */
@ -365,8 +354,6 @@ algo_end:
/* termination, either normal or user imposed. */
if (iflag < 0)
info = iflag;
if (nprint > 0)
iflag = functor.debug(x, fvec, fjac);
return info;
}

View File

@ -21,8 +21,7 @@ public:
const int maxfev = 400,
const Scalar ftol = ei_sqrt(epsilon<Scalar>()),
const Scalar xtol = ei_sqrt(epsilon<Scalar>()),
const Scalar gtol = Scalar(0.),
const int nprint=0
const Scalar gtol = Scalar(0.)
);
Matrix< Scalar, Dynamic, 1 > fvec;
@ -77,8 +76,7 @@ int LevenbergMarquardt<FunctorType,Scalar>::minimize(
const int maxfev,
const Scalar ftol,
const Scalar xtol,
const Scalar gtol,
const int nprint
const Scalar gtol
)
{
const int n = x.size();
@ -143,16 +141,6 @@ int LevenbergMarquardt<FunctorType,Scalar>::minimize(
if (iflag < 0)
break;
/* if requested, call functor.f to enable printing of iterates. */
if (nprint > 0) {
iflag = 0;
if ((iter - 1) % nprint == 0)
iflag = functor.debug(x, fvec, fjac);
if (iflag < 0)
break;
}
/* compute the qr factorization of the jacobian. */
ei_qrfac<Scalar>(m, n, fjac.data(), fjac.rows(), true, ipvt.data(), n, wa1.data(), wa2.data());
@ -340,7 +328,5 @@ algo_end:
/* termination, either normal or user imposed. */
if (iflag < 0)
info = iflag;
if (nprint > 0)
iflag = functor.debug(x, fvec, fjac);
return info;
}

View File

@ -21,8 +21,7 @@ public:
const Scalar ftol = ei_sqrt(epsilon<Scalar>()),
const Scalar xtol = ei_sqrt(epsilon<Scalar>()),
const Scalar gtol = Scalar(0.),
const Scalar epsfcn = Scalar(0.),
const int nprint=0
const Scalar epsfcn = Scalar(0.)
);
Matrix< Scalar, Dynamic, 1 > fvec;
@ -76,8 +75,7 @@ int LevenbergMarquardtNumericalDiff<FunctorType,Scalar>::minimize(
const Scalar ftol,
const Scalar xtol,
const Scalar gtol,
const Scalar epsfcn,
const int nprint
const Scalar epsfcn
)
{
const int n = x.size();
@ -140,16 +138,6 @@ int LevenbergMarquardtNumericalDiff<FunctorType,Scalar>::minimize(
if (iflag < 0)
break;
/* if requested, call functor.f to enable printing of iterates. */
if (nprint > 0) {
iflag = 0;
if ((iter - 1) % nprint == 0)
iflag = functor.debug(x, fvec);
if (iflag < 0)
break;
}
/* compute the qr factorization of the jacobian. */
ei_qrfac<Scalar>(m, n, fjac.data(), fjac.rows(), true, ipvt.data(), n, wa1.data(), wa2.data());
@ -337,8 +325,6 @@ algo_end:
/* termination, either normal or user imposed. */
if (iflag < 0)
info = iflag;
if (nprint > 0)
iflag = functor.debug(x, fvec);
return info;
}

View File

@ -21,8 +21,7 @@ public:
const int maxfev = 400,
const Scalar ftol = ei_sqrt(epsilon<Scalar>()),
const Scalar xtol = ei_sqrt(epsilon<Scalar>()),
const Scalar gtol = Scalar(0.),
const int nprint=0
const Scalar gtol = Scalar(0.)
);
Matrix< Scalar, Dynamic, 1 > fvec;
@ -76,8 +75,7 @@ int LevenbergMarquardtOptimumStorage<FunctorType,Scalar>::minimize(
const int maxfev,
const Scalar ftol,
const Scalar xtol,
const Scalar gtol,
const int nprint
const Scalar gtol
)
{
const int n = x.size();
@ -135,16 +133,6 @@ int LevenbergMarquardtOptimumStorage<FunctorType,Scalar>::minimize(
while (true) {
/* if requested, call functor.f to enable printing of iterates. */
if (nprint > 0) {
iflag = 0;
if ((iter - 1) % nprint == 0)
iflag = functor.debug(x, fvec, wa3);
if (iflag < 0)
break;
}
/* compute the qr factorization of the jacobian matrix */
/* calculated one row at a time, while simultaneously */
/* forming (q transpose)*fvec and storing the first */
@ -355,8 +343,6 @@ algo_end:
/* termination, either normal or user imposed. */
if (iflag < 0)
info = iflag;
if (nprint > 0)
iflag = functor.debug(x, fvec, wa3);
return info;
}