>calculations are done using variables with the screen locked.  It takes
>about 5 seconds to execute the handler for 1,000 data points, which I
>think is fine given my primitive scripting skills; but when I increase
>the size of the data set to 5,000, it takes about 160 seconds or 32
times
>longer.  Would anyone care to share their thoughts on the exponential
>increase in processing time?  (Incidentally, I'm working with a 350 mHz
>iMac, if that is relevant.)
You might try putting the data into an array(accessing elements in an
array should be very fast). If your dealing with a matrix a 2-d array.

For example if I were doing matrix multiplication, the script would be
something like:

function getcolumns tarray
  put  keys(tarray) into tkeys
  repeat for each line i in tkeys
    put item 2 of i&comma after maxlist
  end repeat
  delete last char of maxlist
  return max(maxlist)
end getcolumns

function getrows tarray
  put  keys(tarray) into tkeys
  repeat for each line i in tkeys
    put item 1 of i&comma after maxlist
  end repeat
  delete last char of maxlist
  return max(maxlist)
end getrows

function matrixmultiplyarray tarray1,tarray2
  local tarray3
  put getrows(tarray1) into tlines
  put getcolumns(tarray2) into titems
  put getcolumns(tarray1) into titems2
  repeat with i = 1 to tlines
    repeat with j = 1 to titems
      put 0 into tarray[i,k]
      repeat with k = 1 to titems2
        add tarray1[i,k] * tarray2[k,j] to tarray3[i,j]
      end repeat
    end repeat
  end repeat
  return tarray3
end matrixmultiplyarray

Tuviah


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

Reply via email to