OPALX (Object Oriented Parallel Accelerator Library for Exascal) master (dc2a29eed580)
OPALX
Loading...
Searching...
No Matches
gsl_histogram2d Class Reference

2D histogram with explicit x/y bin edges. More...

#include <GSLHistogram.h>

Collaboration diagram for gsl_histogram2d:
Collaboration graph

Public Member Functions

 gsl_histogram2d ()
 
void set_ranges_uniform (double xmin, double xmax, double ymin, double ymax)
 Set uniform x/y bin edges over \([x_{\min},x_{\max}]\) and \([y_{\min},y_{\max}]\).
 
void accumulate (double x, double y, double weight)
 Accumulate a weighted sample into the 2D histogram.
 
void increment (double x, double y)
 Increment the bin containing x,y by 1.
 
void set_ranges (const double *xrange, size_t nx, const double *yrange, size_t ny)
 Set explicit x/y bin edges.
 
double get (size_t i, size_t j) const
 Get the bin count for index \((i,j)\).
 
size_t nx () const
 Number of x bins.
 
size_t ny () const
 Number of y bins.
 
const std::vector< double > & xrange () const
 X-axis bin edges.
 
const std::vector< double > & yrange () const
 Y-axis bin edges.
 
const std::vector< double > & bin () const
 Bin count array.
 

Public Attributes

size_t nx_
 
size_t ny_
 
std::vector< double > xrange_
 
std::vector< double > yrange_
 
std::vector< double > bin_
 

Private Member Functions

size_t find_x_bin (double x) const
 
size_t find_y_bin (double y) const
 

Detailed Description

2D histogram with explicit x/y bin edges.

Definition at line 176 of file GSLHistogram.h.

Constructor & Destructor Documentation

◆ gsl_histogram2d()

gsl_histogram2d::gsl_histogram2d ( )
inline

Definition at line 178 of file GSLHistogram.h.

Member Function Documentation

◆ accumulate()

void gsl_histogram2d::accumulate ( double  x,
double  y,
double  weight 
)
inline

Accumulate a weighted sample into the 2D histogram.

Parameters
xInput: x sample value.
yInput: y sample value.
weightInput: weight to add to the bin.

Definition at line 206 of file GSLHistogram.h.

References bin_, find_x_bin(), find_y_bin(), nx_, and ny_.

Referenced by gsl_histogram2d_accumulate(), and increment().

Here is the call graph for this function:

◆ bin()

const std::vector< double > & gsl_histogram2d::bin ( ) const
inline

Bin count array.

Returns
Output: reference to counts of size \(n_x n_y\).

Definition at line 257 of file GSLHistogram.h.

References bin_.

Referenced by gsl_histogram2d_fprintf(), and gsl_histogram2d_pdf::init().

◆ find_x_bin()

size_t gsl_histogram2d::find_x_bin ( double  x) const
inlineprivate

Definition at line 266 of file GSLHistogram.h.

References nx_, and xrange_.

Referenced by accumulate().

◆ find_y_bin()

size_t gsl_histogram2d::find_y_bin ( double  y) const
inlineprivate

Definition at line 274 of file GSLHistogram.h.

References ny_, and yrange_.

Referenced by accumulate().

◆ get()

double gsl_histogram2d::get ( size_t  i,
size_t  j 
) const
inline

Get the bin count for index \((i,j)\).

Parameters
iInput: x bin index.
jInput: y bin index.
Returns
Output: bin count.

Definition at line 236 of file GSLHistogram.h.

References bin_, nx_, and ny_.

Referenced by gsl_histogram2d_get().

◆ increment()

void gsl_histogram2d::increment ( double  x,
double  y 
)
inline

Increment the bin containing x,y by 1.

Parameters
xInput: x sample value.
yInput: y sample value.

Definition at line 217 of file GSLHistogram.h.

References accumulate().

Referenced by gsl_histogram2d_increment().

Here is the call graph for this function:

◆ nx()

size_t gsl_histogram2d::nx ( ) const
inline

Number of x bins.

Returns
Output: x bin count.

Definition at line 245 of file GSLHistogram.h.

References nx_.

Referenced by gsl_histogram2d_fprintf(), gsl_histogram2d_nx(), gsl_histogram2d_pdf::init(), set_ranges(), and LaserProfile::setupRNG().

◆ ny()

size_t gsl_histogram2d::ny ( ) const
inline

Number of y bins.

Returns
Output: y bin count.

Definition at line 248 of file GSLHistogram.h.

References ny_.

Referenced by gsl_histogram2d_fprintf(), gsl_histogram2d_ny(), gsl_histogram2d_pdf::init(), set_ranges(), and LaserProfile::setupRNG().

◆ set_ranges()

void gsl_histogram2d::set_ranges ( const double *  xrange,
size_t  nx,
const double *  yrange,
size_t  ny 
)
inline

Set explicit x/y bin edges.

Parameters
xrangeInput: x edges array ( \(n_x+1\)).
nxInput: number of x edges.
yrangeInput: y edges array ( \(n_y+1\)).
nyInput: number of y edges.

Definition at line 224 of file GSLHistogram.h.

References nx(), nx_, ny(), ny_, xrange(), xrange_, yrange(), and yrange_.

Referenced by gsl_histogram2d_set_ranges().

Here is the call graph for this function:

◆ set_ranges_uniform()

void gsl_histogram2d::set_ranges_uniform ( double  xmin,
double  xmax,
double  ymin,
double  ymax 
)
inline

Set uniform x/y bin edges over \([x_{\min},x_{\max}]\) and \([y_{\min},y_{\max}]\).

Parameters
xminInput: x lower bound (inclusive).
xmaxInput: x upper bound (exclusive).
yminInput: y lower bound (inclusive).
ymaxInput: y upper bound (exclusive).

Definition at line 186 of file GSLHistogram.h.

References nx_, ny_, xrange_, and yrange_.

Referenced by gsl_histogram2d_set_ranges_uniform().

◆ xrange()

const std::vector< double > & gsl_histogram2d::xrange ( ) const
inline

X-axis bin edges.

Returns
Output: reference to x edges.

Definition at line 251 of file GSLHistogram.h.

References xrange_.

Referenced by gsl_histogram2d_fprintf(), gsl_histogram2d_pdf::init(), and set_ranges().

◆ yrange()

const std::vector< double > & gsl_histogram2d::yrange ( ) const
inline

Y-axis bin edges.

Returns
Output: reference to y edges.

Definition at line 254 of file GSLHistogram.h.

References yrange_.

Referenced by gsl_histogram2d_fprintf(), gsl_histogram2d_pdf::init(), and set_ranges().

Member Data Documentation

◆ bin_

std::vector<double> gsl_histogram2d::bin_

Definition at line 263 of file GSLHistogram.h.

Referenced by accumulate(), bin(), get(), and gsl_histogram2d_alloc().

◆ nx_

size_t gsl_histogram2d::nx_

◆ ny_

size_t gsl_histogram2d::ny_

◆ xrange_

std::vector<double> gsl_histogram2d::xrange_

Definition at line 261 of file GSLHistogram.h.

Referenced by find_x_bin(), set_ranges(), set_ranges_uniform(), and xrange().

◆ yrange_

std::vector<double> gsl_histogram2d::yrange_

Definition at line 262 of file GSLHistogram.h.

Referenced by find_y_bin(), set_ranges(), set_ranges_uniform(), and yrange().


The documentation for this class was generated from the following file: