Пример #1
0
        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));
        }
Пример #2
0
 public static RrFunction LinearCombination(double[] weights, RrFunction[] funcs)
 {
     return(LinearCombinationRrFunction.Create(weights, funcs));
 }
Пример #3
0
 public static RrFunction Sum(params RrFunction[] functions)
 {
     return(LinearCombinationRrFunction.Create(functions.Select(f => 1.0).ToArray(), functions));
 }