Accelerating "for "loops [message #72946] |
Thu, 14 October 2010 06:31 |
Regine
Messages: 1 Registered: October 2010
|
Junior Member |
|
|
Hello,
I need to know if there's a way to make this code go faster as I am
using very large arrays.
the code is :
nTab=15296820
n_Tag1=5925470
n_Tag2= 2478581
n_Tag3=6892766
FinalTable=make_array(nTab)
;Indice_tag1, Indice_tag2 and Indice_Tag3 are arrays of size n_Tag1,
n_Tag2 and n_Tag3 respectively
for i=0L,nTab-1 do begin
for j=0L,n_Tag1-1 do begin
for k=0L,n_tag2-1 do begin
for l=0L,n_tag3-1 do begin
if i eq Indice_Tag1[j] then begin
FinalTable[i]=Tag1[j]
Endif
if i eq Indice_tag2[k] then begin
FinalTable[i]=tag2[k]
endif
if i eq Indice_tag3[l] then begin
FinalTable[i]=tag3[l]
endif
endfor
endfor
endfor
endfor
END
Thank you in advance for any help that you can provide,
Cheers,
|
|
|