Exemple #1
0
        public static RrFunction Add(StepFunction step, ConstantRrFunction cst)
        {
            if (DoubleUtils.EqualZero(cst.Value))
            {
                return(step);
            }

            var shiftedValues = step.values.Map(v => v + cst.Value);

            return(new StepFunction(step.abscissae, shiftedValues, step.leftValue + cst.Value));
        }
        public static RrFunction Mult(LinearCombinationRrFunction lc, ConstantRrFunction cst)
        {
            if (DoubleUtils.MachineEquality(1.0, cst.Value))
            {
                return(lc);
            }

            if (DoubleUtils.EqualZero(cst.Value))
            {
                return(RrFunctions.Zero);
            }

            return(LinearCombinationRrFunction.Create(lc.Weights.Map(w => w * cst.Value), lc.Functions));
        }
Exemple #3
0
        public static RrFunction Mult(StepFunction step, ConstantRrFunction cst)
        {
            if (DoubleUtils.MachineEquality(cst.Value, 1.0))
            {
                return(step);
            }

            if (DoubleUtils.EqualZero(cst.Value))
            {
                return(RrFunctions.Zero);
            }

            var multValues = step.values.Map(v => v * cst.Value);

            return(new StepFunction(step.abscissae, multValues, step.leftValue * cst.Value));
        }
 public static RrFunction Mult(ExpRrFunction exp, ConstantRrFunction cst)
 {
     return(ExpRrFunction.Create(exp.Weight * cst.Value, exp.Slope));
 }
 public static RrFunction Mult(ConstantRrFunction left, ConstantRrFunction right)
 {
     return(RrFunctions.Constant(left.Value * right.Value));
 }