From 213be7549ba5b33bb292e75c2254a5daff5352d1 Mon Sep 17 00:00:00 2001 From: Vincent Samy Date: Mon, 30 Mar 2020 17:23:23 +0900 Subject: [PATCH] Build and test pass for GCC 7.5.0 --- include/differentiators.h | 2 +- tests/noisy_function_generator.h | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/differentiators.h b/include/differentiators.h index 7768178..6993d98 100644 --- a/include/differentiators.h +++ b/include/differentiators.h @@ -191,7 +191,7 @@ template vectN_t GetCNRISDCoeffs() vectN_t v{}; const vectN_t v0 = CNRCoeffs{}(); v(M) = 0; - for (Eigen::Index k = 1; k < M + 1; ++k) { + for (int k = 1; k < M + 1; ++k) { v(M - k) = T(2) * k * v0(M - k); v(M + k) = T(2) * k * v0(M + k); } diff --git a/tests/noisy_function_generator.h b/tests/noisy_function_generator.h index 884cfc9..8549327 100644 --- a/tests/noisy_function_generator.h +++ b/tests/noisy_function_generator.h @@ -77,11 +77,11 @@ FunctionGenerator polyGenerator(int nrSteps, std::array coeffs, T dt) std::array dCoeffs; for (size_t i = 1; i < N; ++i) - dCoeffs[i - 1] = i * coeffs[i]; + dCoeffs[i - 1] = static_cast(i) * coeffs[i]; std::array ddCoeffs; for (size_t i = 1; i < N - 1; ++i) - ddCoeffs[i - 1] = i * dCoeffs[i]; + ddCoeffs[i - 1] = static_cast(i) * dCoeffs[i]; vectX_t f(nrSteps); vectX_t df(nrSteps); @@ -160,11 +160,11 @@ TVFunctionGenerator tvPolyGenerator(int nrSteps, std::array coeffs, T m std::array dCoeffs; for (size_t i = 1; i < N; ++i) - dCoeffs[i - 1] = i * coeffs[i]; + dCoeffs[i - 1] = static_cast(i) * coeffs[i]; std::array ddCoeffs; for (size_t i = 1; i < N - 1; ++i) - ddCoeffs[i - 1] = i * dCoeffs[i]; + ddCoeffs[i - 1] = static_cast(i) * dCoeffs[i]; vectX_t t(nrSteps); vectX_t f(nrSteps);