public static TensorOld <double> DoDoubleCellByCell <TIn1, TIn2>(this TensorOld <TIn1> t1, TensorOld <TIn2> t2, Func <double, double, double> operation) { var converter1 = NumericUtils.GetConverterToDouble <TIn1>(); var converter2 = NumericUtils.GetConverterToDouble <TIn2>(); return(t1.DoCellByCell(t2, (TIn1 item1, TIn2 item2) => operation(converter1(item1), converter2(item2)))); }
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))); }