From 60a8ccc2ff01d8cfa5264820bbab39725b377dc4 Mon Sep 17 00:00:00 2001 From: Alexander Voigt Date: Thu, 25 Aug 2016 20:04:27 +0200 Subject: [PATCH] Bugfix: no early successful exit when only one element has converged --- src/fixed_point_iterator.hpp | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/fixed_point_iterator.hpp b/src/fixed_point_iterator.hpp index 460b1c44b..3bcf9ff1f 100644 --- a/src/fixed_point_iterator.hpp +++ b/src/fixed_point_iterator.hpp @@ -30,6 +30,7 @@ #include "wrappers.hpp" #include "error.hpp" #include "ewsb_solver.hpp" +#include "gsl_utils.hpp" namespace flexiblesusy { @@ -145,19 +146,16 @@ class Convergence_tester_tadpole { if (precision < 0.) GSL_ERROR("relative tolerance is negative", GSL_EBADTOL); - for (std::size_t i = 0; i < dimension; ++i) { - rel_diff = MaxRelDiff(gsl_vector_get(a, i), gsl_vector_get(b, i)); + const Eigen::ArrayXd aa = to_eigen_array(a), ba = to_eigen_array(b); + const double max_rel_diff = MaxRelDiff(aa, ba); - if (rel_diff > precision) - return GSL_CONTINUE; + if (max_rel_diff > precision) + return GSL_CONTINUE; - if (rel_diff < std::numeric_limits::epsilon()) - return GSL_SUCCESS; - } - - const int status = check_tadpoles(a, parameters); + if (max_rel_diff < std::numeric_limits::epsilon()) + return GSL_SUCCESS; - return status; + return check_tadpoles(a, parameters); } private: