JayBeams
0.1
Another project to have fun coding.
|
The interface that must be met by the binning_strategy in jb::histogram. More...
Public Member Functions | |
sample_type | histogram_min () const |
The minimum value that will be included in the histogram. More... | |
sample_type | histogram_max () const |
The smallest value that will not be included in the histogram. More... | |
sample_type | theoretical_min () const |
The minimum value that can be attained by the samples. More... | |
sample_type | theoretical_max () const |
The minimum value that can be attained by the samples. More... | |
std::size_t | sample2bin (sample_type const &x) const |
Map a variable type into a bin number. More... | |
sample_type | bin2sample (std::size_t i) const |
Map a bin number into the start of its range. More... | |
sample_type | interpolate (sample_type x_a, sample_type x_b, double y_a, double s, double q) const |
Interpolate a x-coordinate given endpoints and y values. More... | |
Public Attributes | |
typedef | sample_type |
The type of the samples. More... | |
The interface that must be met by the binning_strategy in jb::histogram.
Definition at line 5 of file binning_strategy_concept.dox.
sample_type jb::binning_strategy_concept::bin2sample | ( | std::size_t | i | ) | const |
Map a bin number into the start of its range.
sample_type jb::binning_strategy_concept::histogram_max | ( | ) | const |
The smallest value that will not be included in the histogram.
Any sample with such a value or higher is included in the overflow bin.
Notice that the histogram only includes the samples such that: histogram_min() <= sample < histogram_max().
sample_type jb::binning_strategy_concept::histogram_min | ( | ) | const |
The minimum value that will be included in the histogram.
Any sample with a smaller value is included in the underflow bin.
sample_type jb::binning_strategy_concept::interpolate | ( | sample_type | x_a, |
sample_type | x_b, | ||
double | y_a, | ||
double | s, | ||
double | q | ||
) | const |
Interpolate a x-coordinate given endpoints and y values.
Given the two endpoints (x_a,y_a) and (x_b,y_a + s) of a line, and a y value such that y is the [y_a,y_a + s] range, compute the value of \(x\) that most closely satisfies:
\[ {{(x - x_a)} \over {(y - y_a)}} = {{(x_b - x_a)} \over {s}} \]
This function is used to encapsulate rounding differences for different types of samples.
x_a | The x coordinate for the a point. |
y_a | The y coordinate for the a point. |
x_b | The x coordinate for the b point. |
s | The difference between y_b and y_a. |
q | A value in the [y_a,y_b] range. |
std::size_t jb::binning_strategy_concept::sample2bin | ( | sample_type const & | x | ) | const |
Map a variable type into a bin number.
sample_type jb::binning_strategy_concept::theoretical_max | ( | ) | const |
The minimum value that can be attained by the samples.
For example, 86400 if all samples are "secons within a day", or simply std::numberic_limits<sample_type>::max().
sample_type jb::binning_strategy_concept::theoretical_min | ( | ) | const |
The minimum value that can be attained by the samples.
For example, 0 if all samples are known to be positive, or maybe std::numberic_limits<sample_type>::min().
typedef jb::binning_strategy_concept::sample_type |
The type of the samples.
Must be comparable using operator< and operator<=.
Definition at line 12 of file binning_strategy_concept.dox.