public void FilteredFunctionArgumentInterpolationThrowsExceptionOnSet() { IFunction function = FunctionHelper.Get1DFunction <int, int>(); IFunction filtered = function.Filter(new VariableValueFilter <int>(function.Arguments[0], new[] { 0, 1 })); filtered.Arguments[0].InterpolationType = InterpolationType.Linear; }
public void FilteredFunctionArgumentInterpolationAndExtrapolationInSyncWithParent() { IFunction parentFunction = FunctionHelper.Get1DFunction <int, int>(); IFunction filtered = parentFunction.Filter(new VariableValueFilter <int>(parentFunction.Arguments[0], new[] { 0, 1 })); //set a first values parentFunction.Arguments[0].ExtrapolationType = ExtrapolationType.Constant; Assert.AreEqual(ExtrapolationType.Constant, filtered.Arguments[0].ExtrapolationType); //if the extrapolation on the parent changes... parentFunction.Arguments[0].ExtrapolationType = ExtrapolationType.Linear; //... the filtered follows Assert.AreEqual(ExtrapolationType.Linear, filtered.Arguments[0].ExtrapolationType); }