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

Home » Public Forums » archive » Re: hist_nd question
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: hist_nd question [message #52934 is a reply to message #52931] Mon, 05 March 2007 08:05 Go to previous messageGo to previous message
Wox is currently offline  Wox
Messages: 184
Registered: August 2006
Senior Member
On Mon, 05 Mar 2007 16:42:35 +0100, Wox <nomail@hotmail.com> wrote:

> Ok, it's not so simple. The problem is it can fall outside the
> boundries for 1 dimension (-1 or nbins[i] ) and inside for others.
> Since the result is summed to h, expanding the boundries with 1 will
> not work. Any idea how to do this without using a where in the for
> loop?

This is possible, but maybe there is a more efficient way?


<snip>

total_bins=nbins[s[0]-1] ;Accumulate the size of all bins
h=long((V[s[0]-1,*]-mn[s[0]-1])/bs[s[0]-1]) ; 1-dimensional index
hb = h gt -1L ; true: point in range
hb and= h lt nbins[s[0]-1]
for i=s[0]-2,0,-1 do begin
;; The scaled indices, s[n]+a[n-1]*(s[n-1]+a[n-2]*(s[n-2]+...
h*=nbins[i]
hadd=long((V[i,*]-mn[i])/bs[i])
hb and= hadd gt -1L
hb and= hadd lt nbins[i]
h+=hadd
total_bins*=nbins[i]
endfor
; set points not in range to -1
h*=hb
h-= ~hb

<snip>
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Checking for perl
Next Topic: Re: Checking for perl

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

Current Time: Fri Oct 17 23:13:04 PDT 2025

Total time taken to generate the page: 0.96144 seconds