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

Home » Public Forums » archive » Re: Can anyone show me how to do this without loops?
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
Re: Can anyone show me how to do this without loops? [message #4766] Mon, 31 July 1995 00:00
chase is currently offline  chase
Messages: 62
Registered: May 1993
Member
>>>> > "Liam" == Liam Gumley <liamg@ssec.wisc.edu> writes:
In article <3vilva$5uq@spool.cs.wisc.edu> Liam Gumley <liamg@ssec.wisc.edu> writes:


Liam> Can anyone show me how to code this algorithm without loops?

Liam> Data types are:

Liam> degree is an integer
Liam> i = degree + 1
Liam> j = degree + 1
Liam> kx = fltarr( i, j ) ; contains polynomial coefficients
Liam> ky = fltarr( i, j ) ; contains polynomial coefficients
Liam> x0, y0, xi, yi are float variables or vectors

Liam> Here is the code:

Liam> xi = 0.0
Liam> yi = 0.0
Liam> for i = 0, degree do begin
Liam> for j = 0, degree do begin
Liam> xi = xi + kx( i, j ) * x0 ^ j * y0 ^ i
Liam> yi = yi + ky( i, j ) * x0 ^ j * y0 ^ i
Liam> endfor
Liam> endfor

Try this:

x = x0^indgen(degree+1) ; Unfortunately IDL does not have a recursive
y = y0^indgen(degree+1) ; filter operator (AR) to efficiently do this.

xi = y # (kx # x)
yi = y # (ky # x)


Chris
--
===============================
Bldg 24-E188
The Applied Physics Laboratory
The Johns Hopkins University
Laurel, MD 20723-6099
(301)953-6000 x8529
chris.chase@jhuapl.edu
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: XLOADCT problem?
Next Topic: Re: IDL Limits

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

Current Time: Wed Oct 08 17:40:48 PDT 2025

Total time taken to generate the page: 0.00587 seconds