From 645321c38fa65bf98a0e9d52f14b5f2834ed7f87 Mon Sep 17 00:00:00 2001 From: Krishna Vedala <7001608+kvedala@users.noreply.github.com> Date: Thu, 4 Jun 2020 15:21:09 -0400 Subject: [PATCH] make iterator variable i local to threads --- numerical_methods/durand_kerner_roots.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/numerical_methods/durand_kerner_roots.cpp b/numerical_methods/durand_kerner_roots.cpp index 5d5b65bf5..395797bfc 100644 --- a/numerical_methods/durand_kerner_roots.cpp +++ b/numerical_methods/durand_kerner_roots.cpp @@ -106,7 +106,7 @@ std::pair durand_kerner_algo( std::valarray> *roots, bool write_log = false) { long double tol_condition = 1; uint32_t iter = 0; - int i, n; + int n; std::ofstream log_file; if (write_log) { @@ -149,7 +149,7 @@ std::pair durand_kerner_algo( std::complex numerator, denominator; numerator = poly_function(coeffs, (*roots)[n]); denominator = 1.0; - for (i = 0; i < roots->size(); i++) + for (int i = 0; i < roots->size(); i++) if (i != n) denominator *= (*roots)[n] - (*roots)[i];