Matrix calculation causes memory usage to jump
- To: mathgroup at smc.vnet.net
- Subject: [mg50533] Matrix calculation causes memory usage to jump
- From: rze90bdsv02 at sneakemail.com (Alexander Vorobiev)
- Date: Thu, 9 Sep 2004 05:18:16 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
Hi,
I'm having memory usage problem with the following expression:
res = (Plus @@ (MapThread[#1.#2 &, {weights, priceTr}]))/100. //
Chop[#, 10^-7] & // Transpose;
Dimensions of {weights,priceTr} are {{9, 1000, 7}, {9, 7, 4022}} so
that they are 3d 'data cubes' of doubles. When I run the expression,
memory usage jumps 150Mb and more. The result 'res' seems to be too
big as well:
ByteCount[res]/(1024*1024.) --> 76.8517
M = Table[Random[], {4022}, {1000}]; ByteCount[M]/(1024*1024.) -->
30.6855
It it possible to modify the expression to decrease memory usage both
for the calculation and for the result? I don't need any extra
precision, just doubles.
Thanks,
Alex Vorobiev