diff --git a/src/scion/math/InterpolationTable/src/generateTables.hpp b/src/scion/math/InterpolationTable/src/generateTables.hpp index 557e9d1..c0fb16d 100644 --- a/src/scion/math/InterpolationTable/src/generateTables.hpp +++ b/src/scion/math/InterpolationTable/src/generateTables.hpp @@ -63,7 +63,7 @@ void generateTables() { } } - if ( i != nr - 1 ) { + if ( xEnd != this->x().end() ) { std::swap( xStart, xEnd ); std::swap( yStart, yEnd ); diff --git a/src/scion/math/InterpolationTableFunction/src/generateTables.hpp b/src/scion/math/InterpolationTableFunction/src/generateTables.hpp index 4a1dca0..26cbd0d 100644 --- a/src/scion/math/InterpolationTableFunction/src/generateTables.hpp +++ b/src/scion/math/InterpolationTableFunction/src/generateTables.hpp @@ -66,7 +66,7 @@ void generateTables() { } } - if ( i != nr - 1 ) { + if ( xEnd != this->x().end() ) { std::swap( xStart, xEnd ); std::swap( fStart, fEnd );