public void SensitivityFact() { var interp = new LinearInterpolator(new double[] { 0, 10 }, new double[] { 10, 10 }); var r = interp.Sensitivity(5); Assert.Equal(0.5, r[0]); Assert.Equal(0.5, r[1]); r = interp.Sensitivity(0); Assert.Equal(1.0, r[0]); Assert.Equal(0.0, r[1]); r = interp.Sensitivity(60); Assert.Equal(0.0, r[0]); Assert.Equal(1.0, r[1]); var interp2 = new LinearInterpolatorFlatExtrap(new double[] { 0, 10 }, new double[] { 10, 10 }); var r2 = interp2.Sensitivity(5); Assert.Equal(0.5, r2[0]); Assert.Equal(0.5, r2[1]); r2 = interp2.Sensitivity(0); Assert.Equal(1.0, r2[0]); Assert.Equal(0.0, r2[1]); r2 = interp2.Sensitivity(60); Assert.Equal(0.0, r2[0]); Assert.Equal(1.0, r2[1]); var interp3 = new LinearInterpolatorFlatExtrapNoBinSearch(new double[] { 0, 10 }, new double[] { 10, 10 }); var r3 = interp3.Sensitivity(5); Assert.Equal(0.5, r3[0]); Assert.Equal(0.5, r3[1]); r3 = interp3.Sensitivity(0); Assert.Equal(1.0, r3[0]); Assert.Equal(0.0, r3[1]); r3 = interp3.Sensitivity(60); Assert.Equal(0.0, r3[0]); Assert.Equal(1.0, r3[1]); }