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

Home » Public Forums » archive » Re: Efficient sub array extraction
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: Efficient sub array extraction [message #82404] Wed, 12 December 2012 08:01 Go to previous message
Heinz Stege is currently offline  Heinz Stege
Messages: 189
Registered: January 2003
Senior Member
On Tue, 11 Dec 2012 16:00:35 -0800 (PST), markjamie@gmail.com wrote:

> Thanks for your responses. Glad to hear my subscripting was ok. You mention not to use arrays as subscripts - is there a reason for this?

Yes.

There is a big difference between using "subscript ranges", for
example
range=[10,110]
subarr=array[range[0]:range[1]]
or "array subscripts", for example
subscripts=indgen[101]+10s
subarr=array[subscripts]
The results are the same. But using array subscripts is typically
slower and needs more memory during the calculation of the subarray.
The difference may get very huge when subscribing multidimensional
arrays.

The reason probably is similar to the observation, discussed in the
article by David Fanning, cited by Phillip M. Bitzer in a previous
post within this thread. Please read it.

Heinz
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: increment an array subset based on another subset
Next Topic: Re: array manipulation (TOTAL-ing or MEDIAN-ing) in uneven bins

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

Current Time: Wed Oct 08 16:13:00 PDT 2025

Total time taken to generate the page: 0.00442 seconds