public inbox for gsl-discuss@sourceware.org
 help / color / mirror / Atom feed
* Finding a bin in gsl_histogram
@ 2008-08-08 10:52 Patrick Alken
  0 siblings, 0 replies; only message in thread
From: Patrick Alken @ 2008-08-08 10:52 UTC (permalink / raw)
  To: gsl-discuss

Hi,

  I was suprised to see there is no function in the gsl histogram
module to find the bin corresponding to a given x value. There is
an internal function called find() to accomplish this, but I
think it would be useful to make an API for this routine.

  For example I have an application in which I need to bin data
and compute the mean of the data in each bin. This can be done
with a running mean (keeping the current value of the mean as
the bin value) but each time I store a new data point in the
histogram, I need to find which bin it will be stored in so
I can update the bin value appropriately.

  I propose to make a new function gsl_histogram_getbin() which
simply calls the internal find() function to determine the bin
number for a given x. This should probably also be done for the
2d case.

Patrick Alken

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-08-08 10:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-08-08 10:52 Finding a bin in gsl_histogram Patrick Alken

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).