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

Home » Public Forums » archive » Re: Variable stride in array indices
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: Variable stride in array indices [message #15234] Fri, 07 May 1999 00:00 Go to previous message
bowman is currently offline  bowman
Messages: 121
Registered: September 1991
Senior Member
In article <3732EFA0.1F6C49C0@ssec.wisc.edu>, Liam Gumley
<Liam.Gumley@ssec.wisc.edu> wrote:

> IDL> print,(a[x,*])[*,x]
> 0 2 4 6 8
> 20 22 24 26 28
> 40 42 44 46 48
> 60 62 64 66 68
> 80 82 84 86 88

Thanks for the suggestion. I had to stare at this for a while to
understand it, but I do see how it works.

I maintain, however, that

a[0:8:2, 0:9:3]

is simpler, clearer, similar to Fortran 90, and much more amenable to
optimization than

(a[2*FINDGEN(5),*])[*,3*FINDGEN(4)])

In fact, Fortran 90 even allows negative strides. Also, one is never sure
what is going on under the hood in IDL ... i.e., how much array copying
and indirect indexing is happending ... so performance on large arrays may
not be great.

So it seems that IDL (*the array language*) has finally been surpassed by
Fortran! (That's a clumsy attempt to goad RSI into adding this syntax to
the language.)


>> Just for sake of argument, how can this be extended to
>> a five-dimensional parabolic rhomboid?
>
> a = lindgen(10,10,10,10,10)
> x = lindgen(5)*2
> help, ((((a[x,*,*,*,*])[*,x,*,*,*])[*,*,x,*,*])[*,*,*,x,*])[*,*,*, *,x]
> <Expression> LONG = Array[5, 5, 5, 5, 5]

I showed this to a colleague, who's response was, "He's a madman!".

:-)

Ken
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Widget draw problems...
Next Topic: PV-WAVE FAQ suggestions

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

Current Time: Fri Oct 10 13:15:41 PDT 2025

Total time taken to generate the page: 2.10832 seconds