Commit c0169ddd authored by Robert Frohl's avatar Robert Frohl
Browse files

[CHANGE] setInterval() returns the size of the new, mapped histogram;...

[CHANGE] setInterval() returns the size of the new, mapped histogram; WHistogram now uses an array to store the data (see last change)
parent cc6cab83
......@@ -107,9 +107,10 @@ void WHistogram::increment( double value )
( *( m_initialBuckets + index ) )++;
}
void WHistogram::setInterval( double intervalSize )
unsigned int WHistogram::setInterval( double intervalSize )
{
calculateMapping( intervalSize );
return m_nMappedBuckets;
}
void WHistogram::calculateMapping( double intervalSize )
......@@ -171,7 +172,7 @@ unsigned int WHistogram::at( unsigned int index )
unsigned int WHistogram::size() const
{
return m_mappedBuckets ? m_nMappedBuckets : m_nInitialBuckets;
return (m_mappedBuckets ? m_nMappedBuckets : m_nInitialBuckets);
}
double WHistogram::getMin() const
......
......@@ -137,8 +137,10 @@ class WHistogram
* Set the new intervall size.
*
* \param intervalSize size of the interval for each mapped bucket.
*
* \return size of the new (mapped) histogram.
**/
void setInterval( double intervalSize );
unsigned int setInterval( double intervalSize );
/**
* Get the size of the bucket.
......@@ -146,7 +148,7 @@ class WHistogram
* \param index which buckets size is to be returned, starts with 0 which is the bucket
* containing the smalest values.
*
* \return elements in the bucket
* \return elements in the bucket.
**/
unsigned int operator[]( unsigned int index );
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment