|
|
void | add (const Histogram &that) |
| | Add the values from another histogram to this histogram. |
| |
|
void | clear () |
| | Sets all histogram bins to zero. |
| |
|
int | count () const |
| | Returns the sum of all bin counts. |
| |
| int | getHighValueFixed (int need) const |
| | Find the bin above which there are required number of samples. More... |
| |
| int | getHighValueRelative (float ratio) const |
| | Find the bin above which there are required number of samples. More... |
| |
| int | getLowValueFixed (int need) const |
| | Find the bin below which there are required number of samples. More... |
| |
| int | getLowValueRelative (float ratio) const |
| | Find the bin below which there are required number of samples. More... |
| |
| int | highestNonEmpty () const |
| | Returns the highest bin that is not empty. More... |
| |
| | Histogram () |
| | Constructs an empty histogram object. More... |
| |
|
int | largestBin () const |
| | Returns the bin with the largest number of hits. |
| |
| int | lowestNonEmpty () const |
| | Returns the lowest bin that is not empty. More... |
| |
|
T & | operator[] (int i) |
| | Returns a reference to a given bin. |
| |
|
const T & | operator[] (int i) const |
| | Returns a const reference to a given bin. |
| |
|
void | put (int index) |
| | Adds the histogram bin "index" by one. |
| |
| void | putSafe (int index) |
| | Adds the histogram bin "index" by one. More... |
| |
| void | putSafest (int index) |
| | Adds the histogram bin by one. More... |
| |
| size_t | size () const |
| | Returns the number of bins in the histogram. More... |
| |
|
T | sumBins (int bottom, int top) const |
| | Returns the sum of all bins in the given range. |
| |
template<class T, int N>
class Nimble::Histogram< T, N >
Histogram calculation.
This class can be used to calculate histograms of all kinds of values.
Typical use pattern is as follows:
Histogram<unsigned int,256> hist;
hist.clear();
for(...)
hist.put(myFunction());
unsigned median = hist.getLowValueRelative(0.5);
- Author
- Tommi Ilmonen