|
OPALX (Object Oriented Parallel Accelerator Library for Exascal) master (dc2a29eed580)
OPALX
|
#include <algorithm>#include <cmath>#include <cstdio>#include <stdexcept>#include <vector>

Go to the source code of this file.
Classes | |
| class | gsl_histogram |
| 1D histogram with explicit bin edges. More... | |
| class | gsl_histogram2d |
| 2D histogram with explicit x/y bin edges. More... | |
| class | gsl_histogram2d_pdf |
| 2D PDF derived from histogram for sampling. More... | |
Functions | |
| gsl_histogram * | gsl_histogram_alloc (size_t n) |
Allocate a 1D histogram with n bins. | |
| void | gsl_histogram_set_ranges_uniform (gsl_histogram *h, double xmin, double xmax) |
| Set uniform bin edges over \([x_{\min}, x_{\max}]\). | |
| void | gsl_histogram_increment (gsl_histogram *h, double x) |
Increment the bin containing x by 1. | |
| double | gsl_histogram_get (const gsl_histogram *h, size_t i) |
Get the bin count for index i. | |
| void | gsl_histogram_free (gsl_histogram *h) |
Free a histogram allocated by gsl_histogram_alloc. | |
| size_t | gsl_histogram_bins (const gsl_histogram *h) |
| Number of bins in the histogram. | |
| int | gsl_histogram_get_range (const gsl_histogram *h, size_t i, double *lower, double *upper) |
| Get the \([x_i, x_{i+1})\) range for a bin. | |
| int | gsl_histogram_set_ranges (gsl_histogram *h, const double *range, size_t n) |
| Set explicit bin edges for a histogram. | |
| gsl_histogram2d * | gsl_histogram2d_alloc (size_t nx, size_t ny) |
Allocate a 2D histogram with nx by ny bins. | |
| void | gsl_histogram2d_set_ranges_uniform (gsl_histogram2d *h, double xmin, double xmax, double ymin, double ymax) |
| Set uniform x/y bin edges. | |
| 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. | |
| size_t | gsl_histogram2d_nx (const gsl_histogram2d *h) |
| Number of x bins. | |
| size_t | gsl_histogram2d_ny (const gsl_histogram2d *h) |
| Number of y bins. | |
| void | gsl_histogram2d_increment (gsl_histogram2d *h, double x, double y) |
Increment the bin containing x,y by 1. | |
| double | gsl_histogram2d_get (const gsl_histogram2d *h, size_t i, size_t j) |
| Get the bin count for index \((i,j)\). | |
| void | gsl_histogram2d_accumulate (gsl_histogram2d *h, double x, double y, double weight) |
| Accumulate a weighted sample into the 2D histogram. | |
| void | gsl_histogram2d_fprintf (FILE *fh, const gsl_histogram2d *h, const char *xformat, const char *yformat) |
| Print the 2D histogram in a simple text table. | |
| void | gsl_histogram2d_free (gsl_histogram2d *h) |
| Free a 2D histogram. | |
| gsl_histogram2d_pdf * | gsl_histogram2d_pdf_alloc (size_t, size_t) |
| Allocate a 2D histogram PDF. | |
| void | gsl_histogram2d_pdf_init (gsl_histogram2d_pdf *p, const gsl_histogram2d *h) |
| Initialize a PDF from a histogram. | |
| void | gsl_histogram2d_pdf_sample (const gsl_histogram2d_pdf *p, double u, double v, double *x, double *y) |
| Sample from the PDF using two uniform variates. | |
| void | gsl_histogram2d_pdf_free (gsl_histogram2d_pdf *p) |
| Free a 2D histogram PDF. | |
|
inline |
Accumulate a weighted sample into the 2D histogram.
| h | Input/Output: histogram to update. |
| x | Input: x sample value. |
| y | Input: y sample value. |
| weight | Input: weight to add. |
Definition at line 428 of file GSLHistogram.h.
References gsl_histogram2d::accumulate().
Referenced by LaserProfile::fillHistrogram().

|
inline |
Allocate a 2D histogram with nx by ny bins.
| nx | Input: number of x bins. |
| ny | Input: number of y bins. |
Definition at line 364 of file GSLHistogram.h.
References gsl_histogram2d::bin_, gsl_histogram2d::nx_, and gsl_histogram2d::ny_.
Referenced by LaserProfile::fillHistrogram(), TEST_F(), TEST_F(), and TEST_F().
|
inline |
Print the 2D histogram in a simple text table.
| fh | Input: output file handle. |
| h | Input: histogram. |
| xformat | Input: printf-style format string for x values. |
| yformat | Input: printf-style format string for y values. |
Definition at line 437 of file GSLHistogram.h.
References gsl_histogram2d::bin(), gsl_histogram2d::nx(), gsl_histogram2d::ny(), gsl_histogram2d::xrange(), and gsl_histogram2d::yrange().
Referenced by LaserProfile::saveHistogram().

|
inline |
Free a 2D histogram.
| h | Input: histogram to release (can be null). |
Definition at line 454 of file GSLHistogram.h.
Referenced by TEST_F(), TEST_F(), TEST_F(), and LaserProfile::~LaserProfile().
|
inline |
Get the bin count for index \((i,j)\).
| h | Input: histogram. |
| i | Input: x bin index. |
| j | Input: y bin index. |
Definition at line 419 of file GSLHistogram.h.
References gsl_histogram2d::get().
Referenced by TEST_F(), TEST_F(), and TEST_F().

|
inline |
Increment the bin containing x,y by 1.
| h | Input/Output: histogram to update. |
| x | Input: x sample value. |
| y | Input: y sample value. |
Definition at line 410 of file GSLHistogram.h.
References gsl_histogram2d::increment().
Referenced by TEST_F(), TEST_F(), and TEST_F().

|
inline |
Number of x bins.
| h | Input: histogram. |
Definition at line 399 of file GSLHistogram.h.
References gsl_histogram2d::nx().
Referenced by TEST_F().

|
inline |
Number of y bins.
| h | Input: histogram. |
Definition at line 404 of file GSLHistogram.h.
References gsl_histogram2d::ny().
Referenced by TEST_F().

|
inline |
Allocate a 2D histogram PDF.
| nx | Input: number of x bins (unused). |
| ny | Input: number of y bins (unused). |
Definition at line 460 of file GSLHistogram.h.
Referenced by LaserProfile::setupRNG().
|
inline |
Free a 2D histogram PDF.
| p | Input: PDF to release (can be null). |
Definition at line 484 of file GSLHistogram.h.
Referenced by LaserProfile::~LaserProfile().
|
inline |
Initialize a PDF from a histogram.
| p | Input/Output: PDF to initialize. |
| h | Input: source histogram. |
Definition at line 467 of file GSLHistogram.h.
References gsl_histogram2d_pdf::init().
Referenced by LaserProfile::setupRNG().

|
inline |
Sample from the PDF using two uniform variates.
| p | Input: PDF. |
| u | Input: uniform variate in \([0,1]\). |
| v | Input: uniform variate in \([0,1]\). |
| x | Output: sampled x value. |
| y | Output: sampled y value. |
Definition at line 477 of file GSLHistogram.h.
Referenced by LaserProfile::getXY().
|
inline |
Set explicit x/y bin edges.
| h | Input/Output: histogram to configure. |
| xrange | Input: x edges array ( \(n_x+1\)). |
| nx | Input: number of x edges. |
| yrange | Input: y edges array ( \(n_y+1\)). |
| ny | Input: number of y edges. |
Definition at line 390 of file GSLHistogram.h.
References gsl_histogram2d::set_ranges().
Referenced by TEST_F().

|
inline |
Set uniform x/y bin edges.
| h | Input/Output: histogram to configure. |
| xmin | Input: x lower bound (inclusive). |
| xmax | Input: x upper bound (exclusive). |
| ymin | Input: y lower bound (inclusive). |
| ymax | Input: y upper bound (exclusive). |
Definition at line 378 of file GSLHistogram.h.
References gsl_histogram2d::set_ranges_uniform().
Referenced by LaserProfile::fillHistrogram(), TEST_F(), and TEST_F().

|
inline |
Allocate a 1D histogram with n bins.
| n | Input: number of bins. |
Definition at line 111 of file GSLHistogram.h.
References gsl_histogram::bin_, and gsl_histogram::n_.
Referenced by DistributionMoments::computePercentiles(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().
|
inline |
Number of bins in the histogram.
| h | Input: histogram. |
Definition at line 144 of file GSLHistogram.h.
References gsl_histogram::n().
Referenced by TEST_F().

|
inline |
Free a histogram allocated by gsl_histogram_alloc.
| h | Input: histogram to release (can be null). |
Definition at line 139 of file GSLHistogram.h.
Referenced by DistributionMoments::computePercentiles(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().
|
inline |
Get the bin count for index i.
| h | Input: histogram. |
| i | Input: bin index. |
Definition at line 135 of file GSLHistogram.h.
References gsl_histogram::get().
Referenced by TEST_F(), TEST_F(), and TEST_F().

|
inline |
Get the \([x_i, x_{i+1})\) range for a bin.
| h | Input: histogram. |
| i | Input: bin index. |
| lower | Output: lower edge. |
| upper | Output: upper edge. |
Definition at line 152 of file GSLHistogram.h.
References gsl_histogram::n(), and gsl_histogram::range().
Referenced by TEST_F().

|
inline |
Increment the bin containing x by 1.
| h | Input/Output: histogram to update. |
| x | Input: sample value. |
Definition at line 129 of file GSLHistogram.h.
References gsl_histogram::increment().
Referenced by DistributionMoments::computePercentiles(), TEST_F(), TEST_F(), and TEST_F().

|
inline |
Set explicit bin edges for a histogram.
| h | Input/Output: histogram to configure. |
| range | Input: array of \(n\) edges (must be \(n_+1\)). |
| n | Input: number of edges. |
Definition at line 169 of file GSLHistogram.h.
References gsl_histogram::set_ranges().
Referenced by TEST_F().

|
inline |
Set uniform bin edges over \([x_{\min}, x_{\max}]\).
| h | Input/Output: histogram to configure. |
| xmin | Input: lower bound (inclusive). |
| xmax | Input: upper bound (exclusive). |
Definition at line 122 of file GSLHistogram.h.
References gsl_histogram::set_ranges_uniform().
Referenced by DistributionMoments::computePercentiles(), TEST_F(), TEST_F(), and TEST_F().
