Lexis  1.2.0
Vocabulary of events and shared objects for BBP and HBP software
lexis::render::Histogram Class Reference
+ Inheritance diagram for lexis::render::Histogram:
+ Collaboration diagram for lexis::render::Histogram:

Public Member Functions

 Histogram ()
 The minimum value is set to -inf and maximum value is set to -inf. More...
 
Histogramoperator+= (const Histogram &histogram)
 Computes the addition of two histograms and modifies the object. More...
 
bool operator== (const Histogram &rhs) const
 
bool operator!= (const Histogram &rhs) const
 
size_t getMinIndex () const
 
size_t getMaxIndex () const
 
bool isEmpty () const
 
uint64_t getSum () const
 
vmml::Vector2f getRange () const
 
double getRatio (size_t index) const
 Computes the ratio of the value at a given index. More...
 
void resize (size_t newSize)
 Sets the number of bins to newSize and clears the histogram. More...
 
std::vector< vmml::Vector2f > sampleCurve (bool logScale, const vmml::Vector2f &range) const
 Linear sampling of the histogram. More...
 
- Public Member Functions inherited from lexis::render::detail::Histogram
Histogram::Bins & getBins ()
 Get a reference to the Bins dynamic member. More...
 
const Histogram::Bins & getBins () const
 
void setBins (uint64_t const *value, size_t size)
 Set the value of the Bins dynamic object from a uint64_t* and size. More...
 
std::vector< uint64_t > getBinsVector () const
 
void setBins (const std::vector< uint64_t > &value)
 Set the value of the Bins dynamic object from a std::vector< uint64_t >. More...
 
float getMin () const
 
void setMin (float value)
 Set the Min value. More...
 
float getMax () const
 
void setMax (float value)
 Set the Max value. More...
 
void compact (float threshold=0.1f) final
 
 Histogram (const std::vector< uint64_t > &binsValue, const float &minValue, const float &maxValue)
 
 Histogram (const Histogram &rhs)
 
 Histogram (Histogram &&rhs) noexcept
 
 Histogram (const ::zerobuf::Zerobuf &rhs)
 
 Histogram (::zerobuf::AllocatorPtr allocator)
 
Histogramoperator= (const Histogram &rhs)
 
Histogramoperator= (Histogram &&rhs)
 
std::string getSchema () const final
 
std::string getTypeName () const final
 
::zerobuf::uint128_t getTypeIdentifier () const final
 
size_t getZerobufStaticSize () const final
 
size_t getZerobufNumDynamics () const final
 
void _parseJSON (const Json::Value &json) final
 
void _createJSON (Json::Value &json) const final
 

Additional Inherited Members

- Public Types inherited from lexis::render::detail::Histogram
typedef ::zerobuf::Vector< uint64_t > Bins
 
- Static Public Member Functions inherited from lexis::render::detail::Histogram
static std::string ZEROBUF_SCHEMA ()
 
static std::string ZEROBUF_TYPE_NAME ()
 
::zerobuf::uint128_t ZEROBUF_TYPE_IDENTIFIER ()
 
static size_t ZEROBUF_STATIC_SIZE ()
 
static size_t ZEROBUF_NUM_DYNAMICS ()
 
static ConstHistogramPtr create (const void *data, const size_t size)
 

Detailed Description

Definition at line 16 of file Histogram.h.

Constructor & Destructor Documentation

lexis::render::Histogram::Histogram ( )

The minimum value is set to -inf and maximum value is set to -inf.

Member Function Documentation

size_t lexis::render::Histogram::getMaxIndex ( ) const
Returns
the index with the maximum value (if there are multiple indices for max value, the smallest index is returned).
size_t lexis::render::Histogram::getMinIndex ( ) const
Returns
the index with the minimum value (if there are multiple indices for min value, the smallest index is returned).
vmml::Vector2f lexis::render::Histogram::getRange ( ) const
Returns
the data range of the histogram.
double lexis::render::Histogram::getRatio ( size_t  index) const

Computes the ratio of the value at a given index.

Parameters
indexthe index of the histogram value
Returns
the ratio at given index. If histogram is empty or index exceeds the histogram bin count, returns 0.0.
uint64_t lexis::render::Histogram::getSum ( ) const
Returns
the sum of the histogram.
bool lexis::render::Histogram::isEmpty ( ) const
Returns
true if histogram has no values.
bool lexis::render::Histogram::operator!= ( const Histogram rhs) const
Returns
true if two histograms are not identical.
Histogram& lexis::render::Histogram::operator+= ( const Histogram histogram)

Computes the addition of two histograms and modifies the object.

If the histogram is empty this operator behaves the same as the assignment operator.

Parameters
histogramis the histogram to add
Returns
the modified histogram
bool lexis::render::Histogram::operator== ( const Histogram rhs) const
Returns
true if two histograms are identical.
void lexis::render::Histogram::resize ( size_t  newSize)

Sets the number of bins to newSize and clears the histogram.

std::vector< vmml::Vector2f > lexis::render::Histogram::sampleCurve ( bool  logScale,
const vmml::Vector2f &  range 
) const

Linear sampling of the histogram.

Parameters
logScaleuse log for the y-values
rangethe range in [0..1] to use bins from
Returns
list of points from [0..1] in both axis.

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