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

Home » Public Forums » archive » Re: is this a bug in IDL?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: is this a bug in IDL? [message #37376] Tue, 16 December 2003 02:58 Go to previous message
Wonko[3] is currently offline  Wonko[3]
Messages: 9
Registered: February 2003
Junior Member
aramisgm@hotmail.com (Aramis Martinez) wrote:

> k=0
> for i=0,8759 do begin
> x=vbs(2,i)
> if x gt 0.0 then k=k+1 & x=0 & vbs(2,i)=x
> endfor
> print, k

Which is the same as:

k=0
for i=0,8759 do begin
x=vbs(2,i)
if x gt 0.0 then k=k+1
x=0
vbs(2,i)=x
endfor
print, k


> 1) How would you vectorize this? I tried a few things that I could
> remember from my work this summer, but four months of quantum
> mechanics wipes a lot from memory :)

This should do:

index = where( vbs[ 2, lindgen( 8760 ) ] gt 0, k )
if k gt 0 then vbs[ 2, index ] = 0


[...]

> Is this a bug? as far as I can tell, the statements are logically
> identical since an &'s behavior should never vary, so what in the guts
> of IDL would make these statements be different? Is there some rule
> kicking in here that's not so obvious but makes this behavior to be
> expected? Would parenthesis around the THEN block make these identical
> in IDL? The environment is either IDL 6 on Red Hat 9 or IDL 5.1 on
> Red Hat 8.1.

Using & ist the same as wrting the next statement in another line. You
need to use begin and endif statements.

Alex
--
Alex Schuster Wonko@wonkology.org PGP Key available
alex@pet.mpin-koeln.mpg.de
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Re: Linux Colour Display problems
Next Topic: How to make IDL be quiet

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

Current Time: Sat Oct 11 02:01:42 PDT 2025

Total time taken to generate the page: 0.96081 seconds