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

Home » Public Forums » archive » Re: Faster than this...
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: Faster than this... [message #18679] Thu, 03 February 2000 00:00
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
Ricardo Fonseca <zamb@physics.ucla.edu> writes:
>
> I have this line of code in IDL 5.2a
>
> for j=0, N-1 do Data[j]=XAxisData[j]^2*Data[j]
>
> Where both Data and XAxisData have the same dimension N.
> Does anyone know if there is a faster way of doing this
> (i.e. avoiding the for cicle) ?

I hope this isn't a trick question. The expression

Data = XAxisDAta^2 * Data

should work fine. Don't worry about Data being overwritten. The
right hand side is fully evaluated with the "old" value of Data,
before the "new" value of Data is assigned.

Craig

--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Archive?
Next Topic: Re: Non-sequential error

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

Current Time: Fri Oct 10 04:47:40 PDT 2025

Total time taken to generate the page: 0.96014 seconds