comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Avoiding FOR statement
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Avoiding FOR statement [message #6892] Tue, 20 August 1996 00:00
Mario Noyon is currently offline  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
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: [Q]IDL - Clipping ARROWs?
Next Topic: matrix functions expm() & logm()

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 11 05:00:21 PDT 2025

Total time taken to generate the page: 3.60135 seconds