44#include <gtest/gtest.h>
65 EXPECT_DOUBLE_EQ(lower, 0.0);
66 EXPECT_DOUBLE_EQ(upper, 1.0);
69 EXPECT_DOUBLE_EQ(lower, 9.0);
70 EXPECT_DOUBLE_EQ(upper, 10.0);
92 std::vector<double> ranges = {0.0, 1.0, 2.0, 5.0, 10.0, 20.0};
115 for (
size_t i = 0; i < 10; ++i) {
141 std::vector<double> xranges = {0.0, 1.0, 3.0, 6.0};
142 std::vector<double> yranges = {0.0, 2.0, 4.0, 8.0};
166 for (
size_t i = 0; i < 5; ++i) {
167 for (
size_t j = 0; j < 5; ++j) {
gsl_histogram2d * gsl_histogram2d_alloc(size_t nx, size_t ny)
Allocate a 2D histogram with nx by ny bins.
void gsl_histogram2d_increment(gsl_histogram2d *h, double x, double y)
Increment the bin containing x,y by 1.
void gsl_histogram_free(gsl_histogram *h)
Free a histogram allocated by gsl_histogram_alloc.
int gsl_histogram2d_set_ranges(gsl_histogram2d *h, const double *xrange, size_t nx, const double *yrange, size_t ny)
Set explicit x/y bin edges.
int gsl_histogram_get_range(const gsl_histogram *h, size_t i, double *lower, double *upper)
Get the range for a bin.
void gsl_histogram_increment(gsl_histogram *h, double x)
Increment the bin containing x by 1.
double gsl_histogram2d_get(const gsl_histogram2d *h, size_t i, size_t j)
Get the bin count for index .
size_t gsl_histogram2d_nx(const gsl_histogram2d *h)
Number of x bins.
void gsl_histogram_set_ranges_uniform(gsl_histogram *h, double xmin, double xmax)
Set uniform bin edges over .
size_t gsl_histogram2d_ny(const gsl_histogram2d *h)
Number of y bins.
gsl_histogram * gsl_histogram_alloc(size_t n)
Allocate a 1D histogram with n bins.
int gsl_histogram_set_ranges(gsl_histogram *h, const double *range, size_t n)
Set explicit bin edges for a histogram.
void gsl_histogram2d_set_ranges_uniform(gsl_histogram2d *h, double xmin, double xmax, double ymin, double ymax)
Set uniform x/y bin edges.
double gsl_histogram_get(const gsl_histogram *h, size_t i)
Get the bin count for index i.
void gsl_histogram2d_free(gsl_histogram2d *h)
Free a 2D histogram.
size_t gsl_histogram_bins(const gsl_histogram *h)
Number of bins in the histogram.
TEST_F(HistogramTest, UniformRanges)
2D histogram with explicit x/y bin edges.
1D histogram with explicit bin edges.