예제 #1
0
        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));
        }
예제 #2
0
 public override double Eval(double x)
 {
     return(evaluator.Eval(x));
 }
예제 #3
0
 public override double Eval(double x)
 {
     return(stepEval.Eval(x) * weight.Eval(x));
 }