mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-16 10:22:15 -05:00
Interpolation: Fix "trend" extrapolation for value outside of range on high end.
This commit is contained in:
1 parent
bce4dcfe54
commit
bebf59c309
3 files changed
+31
-1
No files matched your search
@@ -117,6 +117,19 @@ TEST( RiaInterpolationToolsTest, ValidIntervalValueTooLowExtrapolationTrend )
|
||||
EXPECT_DOUBLE_EQ( -2.0, res );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
TEST( RiaInterpolationToolsTest, ValidIntervalValueTooHighExtrapolationTrend )
|
||||
{
|
||||
std::vector<double> x = { 0.0, 1.0, 2.0, 3.0 };
|
||||
std::vector<double> y = { 0.0, 1.0, 10.0, 20.0 };
|
||||
|
||||
// Outside interval on low side
|
||||
double res = RiaInterpolationTools::linear( x, y, 4.0, RiaInterpolationTools::ExtrapolationMode::TREND );
|
||||
EXPECT_DOUBLE_EQ( 30.0, res );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in new issue
Block a user