Beispiel #1
0
        public static TensorOld <int> DoIntScalarCellByCell <TIn1, TIn2>(this TensorOld <TIn1> t1, TIn2 val2, Func <int, int, int> operation)
        {
            var converter1 = NumericUtils.GetNumericConverter <TIn1, int>();
            var converter2 = NumericUtils.GetNumericConverter <TIn2, int>();

            int dVal2 = converter2(val2);

            return(t1.DoScalarCellByCell(val2, (TIn1 item1, TIn2 item2) => operation(converter1(item1), dVal2)));
        }
Beispiel #2
0
        public static TensorOld <double> DoDoubleScalarCellByCell <TIn1, TIn2>(this TensorOld <TIn1> t1, TIn2 val2, Func <double, double, double> operation)
        {
            var converter1 = NumericUtils.GetConverterToDouble <TIn1>();
            var converter2 = NumericUtils.GetConverterToDouble <TIn2>();

            double dVal2 = converter2(val2);

            return(t1.DoScalarCellByCell(val2, (TIn1 item1, TIn2 item2) => operation(converter1(item1), dVal2)));
        }