From 0a861618fdce1c758a01a3dc1a4f256e9dad47cd Mon Sep 17 00:00:00 2001 From: Alejandro Gallo Date: Tue, 5 Oct 2021 16:49:30 +0200 Subject: [PATCH] Fix getEnergy bug with index jj <> kk --- atrip.org | 2 +- include/atrip/Equations.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/atrip.org b/atrip.org index 9ddedbd..9840163 100644 --- a/atrip.org +++ b/atrip.org @@ -1480,7 +1480,7 @@ namespace atrip { const size_t iend( std::min( No, ii+blockSize) ); for (size_t k(kk); k < kend; k++){ const double ek(epsi[k]); - const size_t jstart = jj > k ? kk : k; + const size_t jstart = jj > k ? jj : k; for (size_t j(jstart); j < jend; j++){ const double ej(epsi[j]); double facjk( j == k ? 0.5 : 1.0); diff --git a/include/atrip/Equations.hpp b/include/atrip/Equations.hpp index ca6a859..b8496f6 100644 --- a/include/atrip/Equations.hpp +++ b/include/atrip/Equations.hpp @@ -23,7 +23,7 @@ namespace atrip { const size_t iend( std::min( No, ii+blockSize) ); for (size_t k(kk); k < kend; k++){ const double ek(epsi[k]); - const size_t jstart = jj > k ? kk : k; + const size_t jstart = jj > k ? jj : k; for (size_t j(jstart); j < jend; j++){ const double ej(epsi[j]); double facjk( j == k ? 0.5 : 1.0);