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

1D histogram with explicit bin edges. More...

#include <GSLHistogram.h>

Collaboration diagram for gsl_histogram:
Collaboration graph

Public Member Functions

 gsl_histogram ()
 
void set_ranges_uniform (double xmin, double xmax)
 Set uniform bin edges over \([x_{\min}, x_{\max}]\).
 
void set_ranges (const double *range, size_t n)
 Set bin edges from an explicit array.
 
void increment (double x)
 Increment the bin containing x by 1.
 
double get (size_t i) const
 Get the bin count for index i.
 
size_t n () const
 Number of bins.
 
const std::vector< double > & range () const
 Bin edge array.
 
const std::vector< double > & bin () const
 Bin count array.
 

Public Attributes

size_t n_
 
std::vector< double > range_
 
std::vector< double > bin_
 

Private Member Functions

size_t find_bin (double x) const
 

Detailed Description

1D histogram with explicit bin edges.

See also
Documentation on https://www.gnu.org/software/gsl/doc/html/histogram.html
Implementation on https://www.gnu.org/software/gsl/

Definition at line 31 of file GSLHistogram.h.

Constructor & Destructor Documentation

◆ gsl_histogram()

gsl_histogram::gsl_histogram ( )
inline

Definition at line 33 of file GSLHistogram.h.

Member Function Documentation

◆ bin()

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

Bin count array.

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

Definition at line 86 of file GSLHistogram.h.

References bin_.

Referenced by increment().

◆ find_bin()

size_t gsl_histogram::find_bin ( double  x) const
inlineprivate

Definition at line 94 of file GSLHistogram.h.

References bin_, and range_.

Referenced by increment().

◆ get()

double gsl_histogram::get ( size_t  i) const
inline

Get the bin count for index i.

Parameters
iInput: bin index.
Returns
Output: bin count.

Definition at line 71 of file GSLHistogram.h.

References bin_.

Referenced by gsl_histogram_get().

◆ increment()

void gsl_histogram::increment ( double  x)
inline

Increment the bin containing x by 1.

Parameters
xInput: sample value.

Definition at line 61 of file GSLHistogram.h.

References bin(), bin_, and find_bin().

Referenced by gsl_histogram_increment().

Here is the call graph for this function:

◆ n()

size_t gsl_histogram::n ( ) const
inline

Number of bins.

Returns
Output: bin count.

Definition at line 80 of file GSLHistogram.h.

References n_.

Referenced by gsl_histogram_bins(), gsl_histogram_get_range(), and set_ranges().

◆ range()

const std::vector< double > & gsl_histogram::range ( ) const
inline

Bin edge array.

Returns
Output: reference to edges of size \(n+1\).

Definition at line 83 of file GSLHistogram.h.

References range_.

Referenced by gsl_histogram_get_range(), and set_ranges().

◆ set_ranges()

void gsl_histogram::set_ranges ( const double *  range,
size_t  n 
)
inline

Set bin edges from an explicit array.

Parameters
rangeInput: array of \(n+1\) bin edges.
nInput: number of edges (must be \(n_+1\)).

Definition at line 52 of file GSLHistogram.h.

References n(), n_, range(), and range_.

Referenced by gsl_histogram_set_ranges().

Here is the call graph for this function:

◆ set_ranges_uniform()

void gsl_histogram::set_ranges_uniform ( double  xmin,
double  xmax 
)
inline

Set uniform bin edges over \([x_{\min}, x_{\max}]\).

Parameters
xminInput: lower bound (inclusive).
xmaxInput: upper bound (exclusive).

Definition at line 38 of file GSLHistogram.h.

References n_, and range_.

Referenced by gsl_histogram_set_ranges_uniform().

Member Data Documentation

◆ bin_

std::vector<double> gsl_histogram::bin_

Definition at line 91 of file GSLHistogram.h.

Referenced by bin(), find_bin(), get(), gsl_histogram_alloc(), and increment().

◆ n_

size_t gsl_histogram::n_

Definition at line 89 of file GSLHistogram.h.

Referenced by gsl_histogram_alloc(), n(), set_ranges(), and set_ranges_uniform().

◆ range_

std::vector<double> gsl_histogram::range_

Definition at line 90 of file GSLHistogram.h.

Referenced by find_bin(), range(), set_ranges(), and set_ranges_uniform().


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