31 #include "../../common/WAssert.h"
32 #include "../../common/WLimits.h"
33 #include "../../common/exceptions/WOutOfBounds.h"
34 #include "../WDataHandlerEnums.h"
36 #include "WValueSetHistogram.h"
39 WHistogram( valueSet->getMinimumValue(), valueSet->getMaximumValue(), buckets )
45 WHistogram( valueSet.getMinimumValue(), valueSet.getMaximumValue(), buckets )
67 WAssert(
m_nbBuckets > 1,
"WValueSetHistogram::buildHistogram : number of buckets needs to be larger than 1." );
70 WAssert(
m_initialBucketSize > 0.0,
"WValueSetHistogram::buildHistogram() : m_initialBucketSize to small." );
90 for(
size_t i = 0; i < valueSet.
size(); ++i )
101 m_initialBucketSize( histogram.m_initialBucketSize ),
102 m_initialBuckets( histogram.m_initialBuckets ),
103 m_nInitialBuckets( histogram.m_nInitialBuckets ),
104 m_mappedBuckets( histogram.m_mappedBuckets ),
105 m_nMappedBuckets( histogram.m_nMappedBuckets ),
106 m_mappedBucketSize( histogram.m_mappedBucketSize ),
107 m_nbTotalElements( histogram.m_nbTotalElements )
115 WAssert( buckets > 1,
"WValueSetHistogram::WValueSetHistogram : number of buckets needs to be larger than 1." );
117 "WValueSetHistogram::WValueSetHistogram : number of buckets needs to be smaller than the initial bucket count." );
140 if( ( i % ratio == 0 ) && ( i != 0 ) && ( i != m_nInitialBuckets - 1 ) )
205 WAssert( index <
m_nMappedBuckets,
"WValueSetHistogram::at() : index out of range." );
225 return std::make_pair( first, second );
230 if( startIndex > endIndex )
232 std::swap( startIndex, endIndex );
236 if( endIndex >
size() )
238 throw WOutOfBounds( std::string(
"The specified endIndex is out of bounds." ) );
243 while( startIndex != endIndex )
253 for(
size_t i = 0; i < h.
size() - 1; ++i )
258 out << interval.first <<
" " << interval.second <<
" " << std::min( h[ i ],
size_t( 3000 ) ) << std::endl;