Anssi Seppälä wrote:
> I have two big 2-dimensional arrays in mapped files A and B. I need 
> to calculate +/ A * B efficiently and without "out of memory".
> In the case A was a vector the . (dot) can make it +/ . * , but this 
> does not work if A is a matrix. Is there a way to do this without a 
> program loop?

  A +/@:* B
but that should have the same memory requirements as the original

Other formulations are possible (for example: +/ .*"1&.|:), but
maybe for memory issues you'd best use a loop (ideally, one over
very large chunks of data, to amortize the cost of executing J's
primitives).

-- 
Raul

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to