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

Home » Public Forums » archive » Specification for a new array slicing function
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: Specification for a new array slicing function [message #15562 is a reply to message #15437] Thu, 20 May 1999 00:00 Go to previous messageGo to previous message
bowman is currently offline  bowman
Messages: 121
Registered: September 1991
Senior Member
In article <7i0igd$1er$1@readme.uio.no>, steinhh@ulrik.uio.no (Stein Vidar
Hagfors Haugan) wrote:

> There are some issues
> that I would like to clear up, though: What exactly does
> the 0:5:2 sequence mean? Does it mean elements 0:5, sampled
> with a stride of 2? Or does it mean 5 elements sampled with
> a stride of 2, starting from 0? Or is it START:STRIDE:COUNT,
> meaning 2 elements, sampled with a stride of 5?
>
> Just curious.... And I would strongly recommend following
> Fortran conventions, whatever they are....

I have the Numerical Recipies in Fortran 90 book, which has a nice, short
introduction to F90 concepts.

The F90 syntax is a(lower:upper:stride) or as I prefer to think about it
a(from:to:by). It works exactly like a DO (or FOR) loop, which the new
indexing largely replaces. You can have negative strides if upper<lower.
If upper-lower has a different sign than stride, you get a null result.

So in F90

b = a(10:1:-1)

would give a in reverse order. I find thi more appealing that having to
look up the direction parameters in ROTATE.

In IDL this could be

b = a[*:0L:-1]

Still better than F90 because of the * (an the zero-based indexing, of
course :-) ).

Finally, much of F90 was developed to make parallel programming easier. I
would hope that true parallelism is a goal for IDL (rather than just
better ActiveX controls).

Ken

--
Dr. Kenneth P. Bowman, Professor 409-862-4060
Department of Meteorology 409-862-4466 fax
Texas A&M University bowmanATcsrp.tamu.edu
College Station, TX 77843-3150 Replace AT with @
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Still IDL's Table Widget
Next Topic: Skipping a line while reading a file.

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

Current Time: Sun Oct 12 08:46:59 PDT 2025

Total time taken to generate the page: 0.80230 seconds