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

Home » Public Forums » archive » Re: vector of bin indices using histogram?
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: vector of bin indices using histogram? [message #50789 is a reply to message #50782] Wed, 18 October 2006 07:00 Go to previous messageGo to previous message
greg michael is currently offline  greg michael
Messages: 163
Registered: January 2006
Senior Member
Thanks Ben - I never met that function before! Unfortunately, it's
using a bisection search, and comes out a little slower than the the
direct calculation:

pro test2,n
x=randomu(0,n)
h = HISTOGRAM(x, BINSIZE = 0.1, LOC = loc, MIN = 0.0)

t=systime(/seconds)
mx=max(x,min=mn)
b=fix((x-mn)/(mx-mn)*10)
print,"direct calc",systime(/seconds)-t

t=systime(/seconds)
b=VALUE_LOCATE(loc, x)
print,"value_locate",systime(/seconds)-t
end

IDL> test2,5e7
direct calc 1.5470002
value_locate 2.8750000

Well, maybe the direct calculation isn't so inefficient. But histogram
must have known those numbers during its calculation. It's a pity they
got thrown away.

Greg
[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
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: How to Sort/Uniq a list and keep its original index
Next Topic: Re: fast search

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

Current Time: Thu Oct 09 20:22:19 PDT 2025

Total time taken to generate the page: 0.56053 seconds