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

Home » Public Forums » archive » Cumulative max() in *arbitrary* dimension?
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: Cumulative max() in *arbitrary* dimension? [message #79583 is a reply to message #79382] Sat, 10 March 2012 09:21 Go to previous messageGo to previous message
Heinz Stege is currently offline  Heinz Stege
Messages: 189
Registered: January 2003
Senior Member
First: On Fri, 09 Mar 2012 18:58:13 +0100, I wrote:

> for i=off,ns-off,off do a[i]=a[i-off:i-1]>a[i:i+off-1]

There is a mistake. It has to read:

for i=off,n_elements(a)-off,off do a[i]=a[i-off:i-1]>a[i:i+off-1]


Second: My contribution => my work. ;-) I measured the times for an
array a=byte(randomu(seed,60,400,3000),/long). I tested the following
versions:

[1] i1=0 &i2=off-1 & $
for i=1,s[d]-1 do a[i*off]=a[i1:i2]>a[(i1+=off):(i2+=off)]
[2] for i=1,s[d]-1 do $
a[i*off]=a[(i-1)*off:i*off-1]>a[i*off:(i+1)*off-1]
[3] for i=off,n_elements(a)-off,off do a[i]=a[i-off:i-1]>a[i:i+off-1]

I ran each version 2000 times and found no significant differences in
the run-time. There only seems to be a slight trend for [2] beeing the
slowest. However it does not have any practical relevance. Here are
the details:

[1] 134.3 (+/-0.2) ms (calculation of i1 and i2 included)
[2] 134.9 (+/-0.2) ms
[3] 134.2 (+/-0.2) ms

The given errors are statistical standard-errors ("1 sigma").

Heinz
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Quantile regression within IDL
Next Topic: Re: cgHistoPlot - locations and histdata keywords?

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

Current Time: Fri Oct 10 14:14:45 PDT 2025

Total time taken to generate the page: 0.16573 seconds