#include <MRHistogram.h>
Public Member Functions | |
Histogram ()=default | |
MRMESH_API | Histogram (float min, float max, size_t size) |
Initialize histogram with minimum and maximum values, and number of bins. | |
MRMESH_API void | addSample (float sample, size_t count=1) |
Adds sample to corresponding bin. | |
MRMESH_API void | addHistogram (const Histogram &hist) |
Adds bins of input hist to this. | |
MRMESH_API const std::vector< size_t > & | getBins () const |
Gets bins. | |
MRMESH_API float | getMin () const |
Gets minimum value of histogram. | |
MRMESH_API float | getMax () const |
Gets maximum value of histogram. | |
MRMESH_API size_t | getBinId (float sample) const |
Gets id of bin that inherits sample. | |
MRMESH_API std::pair< float, float > | getBinMinMax (size_t binId) const |
Gets minimum and maximum of diapason inherited by bin. | |
size_t | heapBytes () const |
returns the amount of memory this object occupies on heap | |
Simple class for calculating histogram
|
default |
MRMESH_API MR::Histogram::Histogram | ( | float | min, |
float | max, | ||
size_t | size ) |
Initialize histogram with minimum and maximum values, and number of bins.
MRMESH_API void MR::Histogram::addHistogram | ( | const Histogram & | hist | ) |
Adds bins of input hist to this.
MRMESH_API void MR::Histogram::addSample | ( | float | sample, |
size_t | count = 1 ) |
Adds sample to corresponding bin.
MRMESH_API size_t MR::Histogram::getBinId | ( | float | sample | ) | const |
Gets id of bin that inherits sample.
MRMESH_API std::pair< float, float > MR::Histogram::getBinMinMax | ( | size_t | binId | ) | const |
Gets minimum and maximum of diapason inherited by bin.
MRMESH_API const std::vector< size_t > & MR::Histogram::getBins | ( | ) | const |
Gets bins.
MRMESH_API float MR::Histogram::getMax | ( | ) | const |
Gets maximum value of histogram.
MRMESH_API float MR::Histogram::getMin | ( | ) | const |
Gets minimum value of histogram.
|
inlinenodiscard |
returns the amount of memory this object occupies on heap