diff options
author | 2012-11-06 15:25:50 +0100 | |
---|---|---|
committer | 2012-11-06 15:25:50 +0100 | |
commit | a76fbbf39777827200455477a9e3557b6063913f (patch) | |
tree | 6a03f8fcb163fa2c3dc2267c52fd1204f5490309 /unsupported/Eigen/src/NonLinearOptimization/HybridNonLinearSolver.h | |
parent | 959ef37006e60f68b9a9e667bf9da2e14eb0e8af (diff) |
Fix bug #314:
- remove most of the metaprogramming kung fu in MathFunctions.h (only keep functions that differs from the std)
- remove the overloads for array expression that were in the std namespace
Diffstat (limited to 'unsupported/Eigen/src/NonLinearOptimization/HybridNonLinearSolver.h')
-rw-r--r-- | unsupported/Eigen/src/NonLinearOptimization/HybridNonLinearSolver.h | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/unsupported/Eigen/src/NonLinearOptimization/HybridNonLinearSolver.h b/unsupported/Eigen/src/NonLinearOptimization/HybridNonLinearSolver.h index d9ce4eab6..b190827b3 100644 --- a/unsupported/Eigen/src/NonLinearOptimization/HybridNonLinearSolver.h +++ b/unsupported/Eigen/src/NonLinearOptimization/HybridNonLinearSolver.h @@ -52,7 +52,7 @@ public: Parameters() : factor(Scalar(100.)) , maxfev(1000) - , xtol(internal::sqrt(NumTraits<Scalar>::epsilon())) + , xtol(std::sqrt(NumTraits<Scalar>::epsilon())) , nb_of_subdiagonals(-1) , nb_of_superdiagonals(-1) , epsfcn(Scalar(0.)) {} @@ -70,7 +70,7 @@ public: HybridNonLinearSolverSpace::Status hybrj1( FVectorType &x, - const Scalar tol = internal::sqrt(NumTraits<Scalar>::epsilon()) + const Scalar tol = std::sqrt(NumTraits<Scalar>::epsilon()) ); HybridNonLinearSolverSpace::Status solveInit(FVectorType &x); @@ -79,7 +79,7 @@ public: HybridNonLinearSolverSpace::Status hybrd1( FVectorType &x, - const Scalar tol = internal::sqrt(NumTraits<Scalar>::epsilon()) + const Scalar tol = std::sqrt(NumTraits<Scalar>::epsilon()) ); HybridNonLinearSolverSpace::Status solveNumericalDiffInit(FVectorType &x); @@ -185,6 +185,8 @@ template<typename FunctorType, typename Scalar> HybridNonLinearSolverSpace::Status HybridNonLinearSolver<FunctorType,Scalar>::solveOneStep(FVectorType &x) { + using std::abs; + assert(x.size()==n); // check the caller is not cheating us Index j; @@ -276,7 +278,7 @@ HybridNonLinearSolver<FunctorType,Scalar>::solveOneStep(FVectorType &x) ++ncsuc; if (ratio >= Scalar(.5) || ncsuc > 1) delta = (std::max)(delta, pnorm / Scalar(.5)); - if (internal::abs(ratio - 1.) <= Scalar(.1)) { + if (abs(ratio - 1.) <= Scalar(.1)) { delta = pnorm / Scalar(.5); } } @@ -423,6 +425,9 @@ template<typename FunctorType, typename Scalar> HybridNonLinearSolverSpace::Status HybridNonLinearSolver<FunctorType,Scalar>::solveNumericalDiffOneStep(FVectorType &x) { + using std::sqrt; + using std::abs; + assert(x.size()==n); // check the caller is not cheating us Index j; @@ -516,7 +521,7 @@ HybridNonLinearSolver<FunctorType,Scalar>::solveNumericalDiffOneStep(FVectorType ++ncsuc; if (ratio >= Scalar(.5) || ncsuc > 1) delta = (std::max)(delta, pnorm / Scalar(.5)); - if (internal::abs(ratio - 1.) <= Scalar(.1)) { + if (abs(ratio - 1.) <= Scalar(.1)) { delta = pnorm / Scalar(.5); } } |