I found out that,it is INCREDIBLY(like 100 times) faster to use Dot instead of Sum,to perform long sums. But I have not been able to use this alternative to perform the following sum:
a={{b,c},{d,e}};
a[[1]]+a[[2]]
I want to get this output:
{b,c}+{d,e}={b+d,c+e}
I tried:
a.{1,1}
but did not work.
The easy way to do it is:
Sum[a[[i]],{i,1,2}];
But I want to avoid this slow way. Any faster alternative?
Total? – chuy Sep 05 '13 at 17:40Total[a]in this case. What your input does is more simply done asTotal[a, {2}]. – Szabolcs Sep 05 '13 at 17:44