As an ex-Hypercarder, my natural inclination for arrays is to use "item x
of line y of myVar" style of arrays. Of course the myVar[x,y] is neater and
allows more ready translation of Fortran code. So I have run some tests in
Revolution rather than MC but I am assuming that the issues are intrinsic
to MC.

Repeat with i= 1 to 1000
  put random(1000) into line i of myLines
  put line i of myLines into myArray[i]
end repeat

put the ticks into tix
repeat with i=1 to 1000
  put line random(1000) of myLines into line i of anotherLines
end repeat
put the ticks-tix into tixForLines

put the ticks into tix
repeat with i=1 to 1000
  put myArray[random(1000)] into anotherArray[i]
end repeat
put the ticks-tix into tixForArrays

The arrays are slower!

Now increase all of the repeat limits to 10000 and the arrays become much
faster than the lines.

So, for computer-intensive data manipulation for statistical tests where
computation time is a real limit, how can I decide when to go for arrays
and when to go for lines?
Is there a better way to handle the arrays that makes them faster in all
circumstances?


Michael J. Lew

Senior Lecturer
Department of Pharmacology
The University of Melbourne
Parkville 3010
Victoria
Australia

Phone +613 8344 8304

**
New email address: [EMAIL PROTECTED]
**

Archives: http://www.mail-archive.com/metacard@lists.runrev.com/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to <[EMAIL PROTECTED]>, not this list.

Reply via email to