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

2D PDF derived from histogram for sampling. More...

#include <GSLHistogram.h>

Collaboration diagram for gsl_histogram2d_pdf:
Collaboration graph

Public Member Functions

 gsl_histogram2d_pdf ()
 
void init (const gsl_histogram2d *h)
 Initialize a PDF from a 2D histogram.
 
void sample (double u, double v, double *x, double *y)
 Sample \((x,y)\) given two uniform variates.
 

Private Attributes

size_t nx_
 
size_t ny_
 
std::vector< double > xrange_
 
std::vector< double > yrange_
 
std::vector< double > pdf_
 
std::vector< double > cumsum_
 

Detailed Description

2D PDF derived from histogram for sampling.

Definition at line 285 of file GSLHistogram.h.

Constructor & Destructor Documentation

◆ gsl_histogram2d_pdf()

gsl_histogram2d_pdf::gsl_histogram2d_pdf ( )
inline

Definition at line 287 of file GSLHistogram.h.

Member Function Documentation

◆ init()

void gsl_histogram2d_pdf::init ( const gsl_histogram2d h)
inline

Initialize a PDF from a 2D histogram.

Parameters
hInput: histogram providing bin weights.

Definition at line 291 of file GSLHistogram.h.

References gsl_histogram2d::bin(), cumsum_, gsl_histogram2d::nx(), nx_, gsl_histogram2d::ny(), ny_, pdf_, gsl_histogram2d::xrange(), xrange_, gsl_histogram2d::yrange(), and yrange_.

Referenced by gsl_histogram2d_pdf_init().

Here is the call graph for this function:

◆ sample()

void gsl_histogram2d_pdf::sample ( double  u,
double  v,
double *  x,
double *  y 
)
inline

Sample \((x,y)\) given two uniform variates.

Parameters
uInput: uniform variate in \([0,1]\) for x-bin selection.
vInput: uniform variate in \([0,1]\) for y position within the x-bin.
xOutput: sampled x value.
yOutput: sampled y value.

Definition at line 324 of file GSLHistogram.h.

References cumsum_, nx_, ny_, xrange_, and yrange_.

Member Data Documentation

◆ cumsum_

std::vector<double> gsl_histogram2d_pdf::cumsum_
private

Definition at line 356 of file GSLHistogram.h.

Referenced by init(), and sample().

◆ nx_

size_t gsl_histogram2d_pdf::nx_
private

Definition at line 352 of file GSLHistogram.h.

Referenced by init(), and sample().

◆ ny_

size_t gsl_histogram2d_pdf::ny_
private

Definition at line 352 of file GSLHistogram.h.

Referenced by init(), and sample().

◆ pdf_

std::vector<double> gsl_histogram2d_pdf::pdf_
private

Definition at line 355 of file GSLHistogram.h.

Referenced by init().

◆ xrange_

std::vector<double> gsl_histogram2d_pdf::xrange_
private

Definition at line 353 of file GSLHistogram.h.

Referenced by init(), and sample().

◆ yrange_

std::vector<double> gsl_histogram2d_pdf::yrange_
private

Definition at line 354 of file GSLHistogram.h.

Referenced by init(), and sample().


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