Use inclusive boundaries for interpolation.

This commit is contained in:
Kristian Bendiksen 2020-06-05 15:54:22 +02:00
parent 09e14e173d
commit 56753f688d

View File

@ -39,7 +39,7 @@ double RiaInterpolationTools::linear( const std::vector<double>& x, const std::v
int lowerIndex = 0;
for ( int i = 0; i < static_cast<int>( x.size() - 1 ); i++ )
{
if ( x[i] < value && x[i + 1] > value )
if ( x[i] <= value && x[i + 1] >= value )
{
lowerIndex = i;
found = true;