diff --git a/unsupported/Eigen/src/NonLinear/HybridNonLinearSolver.h b/unsupported/Eigen/src/NonLinear/HybridNonLinearSolver.h index bdca46cd4..3d93a9d2c 100644 --- a/unsupported/Eigen/src/NonLinear/HybridNonLinearSolver.h +++ b/unsupported/Eigen/src/NonLinear/HybridNonLinearSolver.h @@ -138,11 +138,11 @@ HybridNonLinearSolver::solve( /* check the input parameters for errors. */ if (n <= 0 || parameters.xtol < 0. || parameters.maxfev <= 0 || parameters.factor <= 0. ) - return RelativeErrorTooSmall; + return ImproperInputParameters; if (mode == 2) for (j = 0; j < n; ++j) if (diag[j] <= 0.) - return RelativeErrorTooSmall; + return ImproperInputParameters; /* evaluate the function at the starting point */ /* and calculate its norm. */ @@ -337,7 +337,6 @@ HybridNonLinearSolver::solve( if (nfev >= parameters.maxfev) return TooManyFunctionEvaluation; - /* Computing MAX */ if (Scalar(.1) * std::max(Scalar(.1) * delta, pnorm) <= epsilon() * xnorm) return TolTooSmall; if (nslow2 == 5) @@ -460,11 +459,11 @@ HybridNonLinearSolver::solveNumericalDiff( /* check the input parameters for errors. */ if (n <= 0 || parameters.xtol < 0. || parameters.maxfev <= 0 || nb_of_subdiagonals < 0 || nb_of_superdiagonals < 0 || parameters.factor <= 0. ) - return RelativeErrorTooSmall; + return ImproperInputParameters; if (mode == 2) for (j = 0; j < n; ++j) if (diag[j] <= 0.) - return RelativeErrorTooSmall; + return ImproperInputParameters; /* evaluate the function at the starting point */ /* and calculate its norm. */ @@ -665,7 +664,6 @@ HybridNonLinearSolver::solveNumericalDiff( if (nfev >= parameters.maxfev) return TooManyFunctionEvaluation; - /* Computing MAX */ if (Scalar(.1) * std::max(Scalar(.1) * delta, pnorm) <= epsilon() * xnorm) return TolTooSmall; if (nslow2 == 5) diff --git a/unsupported/Eigen/src/NonLinear/LevenbergMarquardt.h b/unsupported/Eigen/src/NonLinear/LevenbergMarquardt.h index 96a90810e..f82ccc120 100644 --- a/unsupported/Eigen/src/NonLinear/LevenbergMarquardt.h +++ b/unsupported/Eigen/src/NonLinear/LevenbergMarquardt.h @@ -152,12 +152,12 @@ LevenbergMarquardt::minimize( /* check the input parameters for errors. */ if (n <= 0 || m < n || parameters.ftol < 0. || parameters.xtol < 0. || parameters.gtol < 0. || parameters.maxfev <= 0 || parameters.factor <= 0.) - return RelativeErrorTooSmall; + return ImproperInputParameters; if (mode == 2) for (j = 0; j < n; ++j) if (diag[j] <= 0.) - return RelativeErrorTooSmall; + return ImproperInputParameters; /* evaluate the function at the starting point */ /* and calculate its norm. */ @@ -430,11 +430,11 @@ LevenbergMarquardt::minimizeNumericalDiff( /* check the input parameters for errors. */ if (n <= 0 || m < n || parameters.ftol < 0. || parameters.xtol < 0. || parameters.gtol < 0. || parameters.maxfev <= 0 || parameters.factor <= 0.) - return RelativeErrorTooSmall; + return ImproperInputParameters; if (mode == 2) for (j = 0; j < n; ++j) if (diag[j] <= 0.) - return RelativeErrorTooSmall; + return ImproperInputParameters; /* evaluate the function at the starting point */ /* and calculate its norm. */ @@ -711,12 +711,12 @@ LevenbergMarquardt::minimizeOptimumStorage( /* check the input parameters for errors. */ if (n <= 0 || m < n || parameters.ftol < 0. || parameters.xtol < 0. || parameters.gtol < 0. || parameters.maxfev <= 0 || parameters.factor <= 0.) - return RelativeErrorTooSmall; + return ImproperInputParameters; if (mode == 2) for (j = 0; j < n; ++j) if (diag[j] <= 0.) - return RelativeErrorTooSmall; + return ImproperInputParameters; /* evaluate the function at the starting point */ /* and calculate its norm. */