Also avoiding "out of memory" is important. The special code would be
usefull. In my case A and B are generated from customer and metered
data. Mapped files are a good place to store first all the simulated
data and then make fast computations and control with the data. Also
I understand that this is one area where the 64 bit systems are good.
At 20:43 10.5.2006, you wrote:
The following benchmark gives an idea of the amount of improvement
that would come with having special code for f/@:g :
A=: 1e6 [EMAIL PROTECTED] 0
B=: 1e6 [EMAIL PROTECTED] 0
ts '+/A*B'
0.1022 8.38976e6
ts 'A +/ .* B'
0.030484 1280
Factor of 3 in time and O(n) vs. O(m*n) in space for (m,n) matrices.
----- Original Message -----
From: "Roger Hui" <[EMAIL PROTECTED]>
To: "Programming forum" <[email protected]>
Sent: Wednesday, May 10, 2006 10:35 AM
Subject: Re: [Jprogramming] Multiply&sum for two big arrays
Pointer? Header? What's that? :-)
It's best to avoid implementation concepts like those.
Much better to have special code for f/@:g .
> --- Anssi Seppälä <[EMAIL PROTECTED]> 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?
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm