[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Variable stride in array indices
- Subject: Re: Variable stride in array indices
- From: bowman(at)null.tamu.edu (Kenneth P. Bowman)
- Date: Fri, 07 May 1999 17:48:52 -0500
- Newsgroups: comp.lang.idl-pvwave
- Organization: Posted via RemarQ Communities, Inc.
- References: <firstname.lastname@example.org> <3732EFA0.1F6C49C0@ssec.wisc.edu>
- Xref: news.doit.wisc.edu comp.lang.idl-pvwave:14666
In article <3732EFA0.1F6C49C0@ssec.wisc.edu>, Liam Gumley
> 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
is simpler, clearer, similar to Fortran 90, and much more amenable to
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
> > 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!".