private static RrFunction BinaryOp(StepFunction left, StepFunction right, Func <double, double, double> binaryOp) { var mergedAbscissae = left.abscissae.Union(right.abscissae).OrderBy(p => p).ToArray(); var multValues = mergedAbscissae.Map(p => binaryOp(left.Eval(p), right.Eval(p))); var multLeftValue = binaryOp(left.Eval(double.NegativeInfinity), right.Eval(double.NegativeInfinity)); return(new StepFunction(mergedAbscissae, multValues, multLeftValue)); }
public override double Eval(double x) { return(evaluator.Eval(x)); }
public override double Eval(double x) { return(stepEval.Eval(x) * weight.Eval(x)); }