public void CanInterpolateFact() { var interp = new LinearInterpolator(); interp = new LinearInterpolator(new double[] { 0, 10 }, new double[] { 10, 10 }); Assert.Equal(10.0, interp.Interpolate(100.0)); var i2 = interp.Bump(1, 10, false); Assert.Equal(110.0, i2.Interpolate(100.0)); interp.Bump(1, 10, true); Assert.Equal(110.0, interp.Interpolate(100.0)); var interp2 = new LinearInterpolatorFlatExtrap(); interp2 = new LinearInterpolatorFlatExtrap(new double[] { 0, 10 }, new double[] { 10, 10 }); Assert.Equal(10.0, interp2.Interpolate(100.0)); var i4 = interp2.Bump(1, 10, false); Assert.Equal(20, i4.Interpolate(100.0)); interp2.Bump(1, 10, true); Assert.Equal(20, interp2.Interpolate(100.0)); var interp3 = new LinearInterpolatorFlatExtrapNoBinSearch(); interp3 = new LinearInterpolatorFlatExtrapNoBinSearch(new double[] { 0, 10 }, new double[] { 10, 10 }); Assert.Equal(10.0, interp3.Interpolate(100.0)); var i5 = interp3.Bump(1, 10, false); Assert.Equal(20, i5.Interpolate(100.0)); interp3.Bump(1, 10, true); Assert.Equal(20, interp3.Interpolate(100.0)); }