MeshLib
 
Loading...
Searching...
No Matches
MR::Histogram Class Reference

#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
 

Detailed Description

Simple class for calculating histogram

Constructor & Destructor Documentation

◆ Histogram() [1/2]

MR::Histogram::Histogram ( )
default

◆ Histogram() [2/2]

MRMESH_API MR::Histogram::Histogram ( float min,
float max,
size_t size )

Initialize histogram with minimum and maximum values, and number of bins.

Member Function Documentation

◆ addHistogram()

MRMESH_API void MR::Histogram::addHistogram ( const Histogram & hist)

Adds bins of input hist to this.

◆ addSample()

MRMESH_API void MR::Histogram::addSample ( float sample,
size_t count = 1 )

Adds sample to corresponding bin.

◆ getBinId()

MRMESH_API size_t MR::Histogram::getBinId ( float sample) const

Gets id of bin that inherits sample.

◆ getBinMinMax()

MRMESH_API std::pair< float, float > MR::Histogram::getBinMinMax ( size_t binId) const

Gets minimum and maximum of diapason inherited by bin.

◆ getBins()

MRMESH_API const std::vector< size_t > & MR::Histogram::getBins ( ) const

Gets bins.

◆ getMax()

MRMESH_API float MR::Histogram::getMax ( ) const

Gets maximum value of histogram.

◆ getMin()

MRMESH_API float MR::Histogram::getMin ( ) const

Gets minimum value of histogram.

◆ heapBytes()

size_t MR::Histogram::heapBytes ( ) const
inlinenodiscard

returns the amount of memory this object occupies on heap


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