Can I speed up a matrix * tensor calculation?
- To: mathgroup at smc.vnet.net
- Subject: [mg111303] Can I speed up a matrix * tensor calculation?
- From: Jagra <jagra24891 at mypacks.net>
- Date: Tue, 27 Jul 2010 04:15:48 -0400 (EDT)
I have a tensor and a matrix. Both pretty large. Both have real
numbers with machine precision:
Dimensions[matrix]
{10000, 5000}
Dimensions[tensor]
{5000, 7, 10000}
I need to do the following:
Total[matrix]* Transpose[tensor {2, 3, 1}]];
but this runs very slowly. I've thought I needed to transpose the
tensor to multiply it properly.
The result should give me a vector of 5000 elements.
Any suggestions that can speed this up?
Thanks.
J