This is the mail archive of the gsl-discuss@sources.redhat.com mailing list for the GSL project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

gsl_histogram_sum proposal


Here is a proposal for an additional function in histogram/stat.c:

double 
gsl_histogram_sum(gsl_histogram * h)
{
  double sum=0;
  size_t i;

  for (i = 0; i < h->n; i++)
    {
      sum+=h->bin[i];
    }

  return sum;
}

Using gsl_histogram_increment() it gives you the number of samples, you have
added to the histogram. Maybe someone is missing it, too.

Yours, Achim



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]