Skip to content

Commit

Permalink
Bugfix: no early successful exit when only one element has converged
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Voigt authored and Alexander Voigt committed Aug 25, 2016
1 parent 21118fe commit 60a8ccc
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions src/fixed_point_iterator.hpp
Expand Up @@ -30,6 +30,7 @@
#include "wrappers.hpp"
#include "error.hpp"
#include "ewsb_solver.hpp"
#include "gsl_utils.hpp"

namespace flexiblesusy {

Expand Down Expand Up @@ -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<double>::epsilon())
return GSL_SUCCESS;
}

const int status = check_tadpoles(a, parameters);
if (max_rel_diff < std::numeric_limits<double>::epsilon())
return GSL_SUCCESS;

return status;
return check_tadpoles(a, parameters);
}

private:
Expand Down

0 comments on commit 60a8ccc

Please sign in to comment.