Clipper
|
General histogram class. More...
#include <clipper_stats.h>
Public Member Functions | |
Histogram () | |
null constructor | |
Histogram (const Range< ftype > &range, const int &n) | |
constructor: from range and sampling | |
void | accumulate (const ftype &x) |
add value to histogram (if it is in range) | |
void | accumulate (const ftype &x, const ftype &w) |
add specified value to histogram (if it is in range) | |
ftype | sum () const |
return sum of whole histogram | |
const ftype & | y (const int &i) const |
return value at index in histogram (Note: no bound check on i) | |
ftype | y (const ftype &x) const |
return value at interpolated position in histogram | |
const Histogram & | operator+= (const Histogram &h) |
add the contents of two histograms (size must match) | |
ftype | x (const int &i) const |
ftype | x_min (const int &i) const |
ftype | x_max (const int &i) const |
int | size () const |
![]() | |
Range_sampling () | |
null constructor | |
Range_sampling (const int &n) | |
constructor: from number of samplings | |
Range_sampling (const Range< ftype > &range, const int &n) | |
constructor: from range and number of samplings | |
ftype | indexf (const ftype &x) const |
return fractional posn in counting range from x-value (0..n) | |
ftype | x (const ftype &i) const |
return x-value (0..n) from fractional posn in counting range | |
int | index (const ftype &x) const |
return nearest index to particular x-value | |
int | index_bounded (const ftype &x) const |
return nearest index to particular x-value (bounded 0...n-1) | |
ftype | x (const int &i) const |
return x-value corresponding to centre of i'th range | |
ftype | x_min (const int &i) const |
return x-value corresponding to bottom of i'th range | |
ftype | x_max (const int &i) const |
return x-value corresponding to top of i'th range | |
int | size () const |
return number of samplings in range | |
![]() | |
Range () | |
null constructor | |
Range (const ftype &min, const ftype &max) | |
constructor | |
const ftype & | min () const |
minimum value | |
const ftype & | max () const |
maximum value | |
ftype | range () const |
range = max - min | |
void | include (const ftype &datum) |
update limits to include a new datum | |
bool | contains (const ftype &datum) const |
test if data is within limits ( min <= datum <= max ) | |
ftype | truncate (const ftype &datum) const |
truncate data to be within range | |
General histogram class.
This class is used to accumulate and access a histogram of values spread over a specified range. On storing data or retrieving by interpolation the range is checked.