Public Member Functions | Protected Member Functions | Protected Attributes
vcg::Histogram< ScalarType > Class Template Reference

#include <histogram.h>

List of all members.

Public Member Functions

void Add (ScalarType v, ScalarType increment=ScalarType(1.0))
 Maximum element that has been added to the histogram. It could be < or > than MinV;..
ScalarType Avg ()
 Returns the average of the data.
ScalarType BinCount (ScalarType v)
ScalarType BinCount (ScalarType v, ScalarType width)
ScalarType BinCountInd (int index)
ScalarType BinLowerBound (int index)
int BinNum () const
 Max number of elements among all buckets between MinV and MaxV.
ScalarType BinUpperBound (int index)
ScalarType BinWidth (ScalarType v)
void Clear ()
 Reset histogram data.
ScalarType Cnt ()
 Total sum of inserted values.
void FileWrite (const std::string &filename)
 Dump the histogram to a file.
ScalarType MaxCount () const
ScalarType MaxCountInRange () const
 Max number of elements among all buckets (including the two infinity bounded buckets)
ScalarType MaxElem ()
 Minimum element that has been added to the histogram. It could be < or > than MinV;.
ScalarType MaxV ()
 Minimum value of the range where the histogram is defined.
ScalarType MinElem ()
ScalarType MinV ()
ScalarType Percentile (ScalarType frac) const
ScalarType RangeCount (ScalarType rangeMin, ScalarType rangeMax)
ScalarType RMS ()
 Returns the Root Mean Square of the data.
void SetRange (ScalarType _minv, ScalarType _maxv, int _n, ScalarType gamma=1.0)
ScalarType StandardDeviation ()
 Returns the standard deviation of the data.
ScalarType Sum ()
 Maximum value of the range where the histogram is defined.
ScalarType Variance ()
 Returns the variance of the data.

Protected Member Functions

int BinIndex (ScalarType val)
 Root mean square.

Protected Attributes

ScalarType cnt
 Number of vaild intervals stored between minv and maxv.
std::vector< ScalarTypeH
ScalarType maxElem
 Minimum value.
ScalarType maxv
 Minimum value.
ScalarType minElem
 Maximum value.
ScalarType minv
 Range for bins.
int n
 Maximum value.
std::vector< ScalarTypeR
 Counters for bins.
ScalarType rms
 Average.
ScalarType sum
 Number of accumulated samples.

Detailed Description

template<class ScalarType>
class vcg::Histogram< ScalarType >

Histogram.

This class implements a single-value histogram.

Definition at line 126 of file histogram.h.


Member Function Documentation

template<class ScalarType>
void vcg::Histogram< ScalarType >::Add ( ScalarType  v,
ScalarType  increment = ScalarType(1.0) 
)

Maximum element that has been added to the histogram. It could be < or > than MinV;..

Add a new value to the histogram.

The statistics related to the histogram data (average, RMS, etc.) are also updated.

Definition at line 309 of file histogram.h.

template<class ScalarType>
ScalarType vcg::Histogram< ScalarType >::Avg ( ) [inline]

Returns the average of the data.

Definition at line 201 of file histogram.h.

template<class ScalarType>
ScalarType vcg::Histogram< ScalarType >::BinCount ( ScalarType  v)

Definition at line 322 of file histogram.h.

template<class ScalarType>
ScalarType vcg::Histogram< ScalarType >::BinCount ( ScalarType  v,
ScalarType  width 
)

Definition at line 328 of file histogram.h.

template<class ScalarType>
ScalarType vcg::Histogram< ScalarType >::BinCountInd ( int  index) [inline]

Definition at line 186 of file histogram.h.

template<class ScalarType>
int vcg::Histogram< ScalarType >::BinIndex ( ScalarType  val) [protected]

Root mean square.

Returns the index of the bin which contains a given value.

Definition at line 281 of file histogram.h.

template<class ScalarType>
ScalarType vcg::Histogram< ScalarType >::BinLowerBound ( int  index) [inline]

Definition at line 188 of file histogram.h.

template<class ScalarType>
int vcg::Histogram< ScalarType >::BinNum ( ) const [inline]

Max number of elements among all buckets between MinV and MaxV.

Definition at line 184 of file histogram.h.

template<class ScalarType>
ScalarType vcg::Histogram< ScalarType >::BinUpperBound ( int  index) [inline]

Definition at line 189 of file histogram.h.

template<class ScalarType>
ScalarType vcg::Histogram< ScalarType >::BinWidth ( ScalarType  v)

Definition at line 345 of file histogram.h.

template<class ScalarType >
void vcg::Histogram< ScalarType >::Clear ( )

Reset histogram data.

Definition at line 220 of file histogram.h.

template<class ScalarType>
ScalarType vcg::Histogram< ScalarType >::Cnt ( ) [inline]

Total sum of inserted values.

Definition at line 169 of file histogram.h.

template<class ScalarType >
void vcg::Histogram< ScalarType >::FileWrite ( const std::string &  filename)

Dump the histogram to a file.

Definition at line 352 of file histogram.h.

template<class ScalarType >
ScalarType vcg::Histogram< ScalarType >::MaxCount ( ) const

Definition at line 365 of file histogram.h.

template<class ScalarType >
ScalarType vcg::Histogram< ScalarType >::MaxCountInRange ( ) const

Max number of elements among all buckets (including the two infinity bounded buckets)

Definition at line 371 of file histogram.h.

template<class ScalarType>
ScalarType vcg::Histogram< ScalarType >::MaxElem ( ) [inline]

Minimum element that has been added to the histogram. It could be < or > than MinV;.

Definition at line 172 of file histogram.h.

template<class ScalarType>
ScalarType vcg::Histogram< ScalarType >::MaxV ( ) [inline]

Minimum value of the range where the histogram is defined.

Definition at line 167 of file histogram.h.

template<class ScalarType>
ScalarType vcg::Histogram< ScalarType >::MinElem ( ) [inline]

Definition at line 171 of file histogram.h.

template<class ScalarType>
ScalarType vcg::Histogram< ScalarType >::MinV ( ) [inline]

Definition at line 166 of file histogram.h.

template<class ScalarType>
ScalarType vcg::Histogram< ScalarType >::Percentile ( ScalarType  frac) const

Returns the value corresponding to a given percentile of the data.

The percentile range between 0 and 1.

Definition at line 381 of file histogram.h.

template<class ScalarType>
ScalarType vcg::Histogram< ScalarType >::RangeCount ( ScalarType  rangeMin,
ScalarType  rangeMax 
)

Definition at line 334 of file histogram.h.

template<class ScalarType>
ScalarType vcg::Histogram< ScalarType >::RMS ( ) [inline]

Returns the Root Mean Square of the data.

Definition at line 204 of file histogram.h.

template<class ScalarType>
void vcg::Histogram< ScalarType >::SetRange ( ScalarType  _minv,
ScalarType  _maxv,
int  _n,
ScalarType  gamma = 1.0 
)

Set the histogram values.

This method is used to correctly initialize the bins of the histogram. n is the number of valid intervals between minv and maxv. for a more robust working, the Histogram class stores also the two out of range intervals (-inf, minv] and [maxv, +inf) Each bin is left closed (eg it contains the value The gamma parameter is applied to modify the distribution of the ranges of the bins. Default uniform distibution.

Definition at line 252 of file histogram.h.

template<class ScalarType>
ScalarType vcg::Histogram< ScalarType >::StandardDeviation ( ) [inline]

Returns the standard deviation of the data.

Definition at line 210 of file histogram.h.

template<class ScalarType>
ScalarType vcg::Histogram< ScalarType >::Sum ( ) [inline]

Maximum value of the range where the histogram is defined.

Definition at line 168 of file histogram.h.

template<class ScalarType>
ScalarType vcg::Histogram< ScalarType >::Variance ( ) [inline]

Returns the variance of the data.

Definition at line 207 of file histogram.h.


Member Data Documentation

template<class ScalarType>
ScalarType vcg::Histogram< ScalarType >::cnt [protected]

Number of vaild intervals stored between minv and maxv.

incrementally updated values

Definition at line 142 of file histogram.h.

template<class ScalarType>
std::vector<ScalarType> vcg::Histogram< ScalarType >::H [protected]

Definition at line 132 of file histogram.h.

template<class ScalarType>
ScalarType vcg::Histogram< ScalarType >::maxElem [protected]

Minimum value.

Definition at line 137 of file histogram.h.

template<class ScalarType>
ScalarType vcg::Histogram< ScalarType >::maxv [protected]

Minimum value.

Definition at line 135 of file histogram.h.

template<class ScalarType>
ScalarType vcg::Histogram< ScalarType >::minElem [protected]

Maximum value.

Definition at line 136 of file histogram.h.

template<class ScalarType>
ScalarType vcg::Histogram< ScalarType >::minv [protected]

Range for bins.

Definition at line 134 of file histogram.h.

template<class ScalarType>
int vcg::Histogram< ScalarType >::n [protected]

Maximum value.

Definition at line 138 of file histogram.h.

template<class ScalarType>
std::vector<ScalarType> vcg::Histogram< ScalarType >::R [protected]

Counters for bins.

Definition at line 133 of file histogram.h.

template<class ScalarType>
ScalarType vcg::Histogram< ScalarType >::rms [protected]

Average.

Definition at line 144 of file histogram.h.

template<class ScalarType>
ScalarType vcg::Histogram< ScalarType >::sum [protected]

Number of accumulated samples.

Definition at line 143 of file histogram.h.


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


shape_reconstruction
Author(s): Roberto Martín-Martín
autogenerated on Sat Jun 8 2019 18:41:16