This is the mail archive of the
gsl-discuss@sources.redhat.com
mailing list for the GSL project.
proposal gsl_histogram_set_ranges_uniform
- To: gsl discussion list <gsl-discuss at sources dot redhat dot com>
- Subject: proposal gsl_histogram_set_ranges_uniform
- From: Achim Gaedke <achim at zpr dot uni-koeln dot de>
- Date: Mon, 25 Jun 2001 11:30:02 +0200 (MET DST)
Hello!
Sometimes it is overkill to delete an old histogram and allocate a new.
But for convenience this function may be added to gsl_histogram.
int gsl_histogram_set_ranges_uniform(gsl_histogram* h, double xmin,
double xmax )
{
size_t i;
if (xmin >= xmax)
{
GSL_ERROR_VAL ("xmin must be less than xmax", GSL_EINVAL, 0);
}
for (i = 0; i < h->n + 1; i++)
{
h->range[i] = xmin + ((double) i / (double) h->n) * (xmax - xmin);
}
return h->n;
}
Yours,
Achim
PS: gsl_ran_gaussian_tail works...
Achim Gaedke, ZPR
Weyertal 80, 50931 Köln
Tel: +49 221 470 6021