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 #15564 is a reply to message #15437] Thu, 20 May 1999 00:00 Go to previous messageGo to previous message
Martin Schultz is currently offline  Martin Schultz
Messages: 515
Registered: August 1997
Senior Member
Liam Gumley wrote:
>

> I agree that START, STRIDE, COUNT are somewhat wordy. However I'd like
> to be able to specify them in any combination, e.g.
> I'm not sure I know a clean way to allow these combinations, other than
> using optional keywords.

well, if you set the ones you don't need to -1 (as this was suggested to
specify "all"). But at least for STRIDE, -1 should be possible as such
(see my other post).

> START only, or ARREX(array,START)
> STRIDE only, or ARREX(array,-1,-1,STRIDE)
> COUNT only, or ARREX(array,0,COUNT-1) ; you need a start to count !
> START and STRIDE, or ARREX(array,START,-1,STRIDE)
> START and COUNT, or ARREX(array,START,START+COUNT)
> STRIDE and COUNT, or ARREX(array,0,COUNT-1,STRIDE)
> START and STRIDE and COUNT. ARREX(array,START,START+COUNT,STRIDE)


Note that I used START,END,STRIDE as in F90.

Also: while START,END,STRIDE can be multi-dimensional, they must have
the same dimensions - -1 being an exception, e.g.
array=fltarr(10,10,10)
start=[0,0,5]
stride=[2,2,1]
help,arrex(array,start,-1,stride) should yield ARRAY[5,5,5]

Also, perhaps, an undefined parameter should also be interpreted as
"ALL" (and then be returned as -1), i.e. in the above example
arrex(array,start,theend,stride) should yield the same result
although THEEND wasn't defined

A boolean /REFORM keyword would be a nice feature.


Martin.

--

|||||||||||||||\\\\\\\\\\\\\-------------------///////////// //|||||||||||||||
Martin Schultz, DEAS, Harvard University, 29 Oxford St., Pierce 109,
Cambridge, MA 02138 phone (617) 496 8318 fax (617) 495 4551
e-mail mgs@io.harvard.edu web http://www-as/people/staff/mgs/
[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: Tue Dec 02 08:44:47 PST 2025

Total time taken to generate the page: 0.72878 seconds