Avoiding FOR statement [message #6892] |
Tue, 20 August 1996 00:00 |
Mario Noyon
Messages: 11 Registered: August 1996
|
Junior Member |
|
|
I have aserious problem with IDL :
I want to use POLY_FIT with an array arr1(256, 256, 9) and arr2(9). Well, I
have to use it with a for statement by doing this :
FOR i = 0, 255 DO BEGIN
FOR j = 0, 255 DO BEGIN
res = POLY_FIT(arr1(i, j, *), arr2(*), yfit, 1)
coef(i, j) = res(1) ;I only need the slope
END
END
Which slows down my program a lot (about 2 minutes). I tried to use some
home-built routines, but none of them gives the accuracy of POLYFIT. I need an
accuracy of about 1e-9.
I watched the code of POLY_FIT, but they use a mthod with an invert matrix. And
I don't know how to adjust it for my precise case.
Thanks in advance to those who can help me.
--
NOYON Mario
Computer Science engineer
University of Bordeaux 2
mnoyon@jmc-luni.u-bordeaux2.fr
|
|
|