Getting rid of large nested FOR loops [message #40591] |
Tue, 17 August 2004 12:37 |
paulo
Messages: 2 Registered: August 2004
|
Junior Member |
|
|
Hi,
My code has three nested FOR loops (ops!)... well, the original code
in
FORTRAN has three nested FOR loops, but I'm re-writing (and improving)
it to IDL. I've read the J.D. Smith's tutorial about vectorizing but
the problem is that my inner loop is variable, it runs until the data
converges... and I'm dealing with lots of data, something like this:
for i=0,120...
for j=0,100...
for k=0,(variable: 2 to 1000) where I use BESELJ function (it
seems to be the weak point) and maybe the memory usage will slow me
down if I vectorize it... I know it sounds a little vague, but the
code is rather simple, but I need
it to be faster (it takes about 30 sec on a 1.2GHZ P4 / 1GB RAM). Is
it better to vectorize the whole thing (hard stuff!), the inner loop
or the outter loops? Or maybe another solution?
Thanks,
PJ Sim�es
|
|
|