@@ -39,7 +39,7 @@ class SymbolStatistics
3939 class Iterator
4040 {
4141 public:
42- Iterator (size_t index, const SymbolStatistics& stats);
42+ Iterator (int64_t index, const SymbolStatistics& stats);
4343
4444 using difference_type = int64_t ;
4545 using value_type = std::pair<uint32_t , uint32_t >;
@@ -54,7 +54,7 @@ class SymbolStatistics
5454 bool operator !=(const Iterator& other) const ;
5555
5656 private:
57- size_t mIndex ;
57+ int64_t mIndex ;
5858 const SymbolStatistics& mStats ;
5959 };
6060
@@ -63,7 +63,7 @@ class SymbolStatistics
6363 SymbolStatistics (const IT begin, const IT end, size_t range = 0 );
6464
6565 template <typename IT>
66- SymbolStatistics (const IT begin, const IT end, size_t min, size_t max, size_t messageLength);
66+ SymbolStatistics (const IT begin, const IT end, int64_t min, int64_t max, size_t messageLength);
6767
6868 void rescaleToNBits (size_t bits);
6969
@@ -75,7 +75,7 @@ class SymbolStatistics
7575
7676 size_t getMessageLength () const ;
7777
78- std::pair<uint32_t , uint32_t > operator [](size_t index) const ;
78+ std::pair<uint32_t , uint32_t > operator [](int64_t index) const ;
7979
8080 SymbolStatistics::Iterator begin () const ;
8181 SymbolStatistics::Iterator end () const ;
@@ -88,8 +88,8 @@ class SymbolStatistics
8888 template <typename IT>
8989 void buildFrequencyTable (const IT begin, const IT end, size_t range);
9090
91- int mMin ;
92- int mMax ;
91+ int64_t mMin ;
92+ int64_t mMax ;
9393 size_t mNUsedAlphabetSymbols ;
9494 size_t mMessageLength ;
9595
@@ -171,7 +171,7 @@ SymbolStatistics::SymbolStatistics(const IT begin, const IT end, size_t range) :
171171}
172172
173173template <typename IT>
174- SymbolStatistics::SymbolStatistics (const IT begin, const IT end, size_t min, size_t max, size_t messageLength) : mMin (min), mMax (max), mNUsedAlphabetSymbols (0 ), mMessageLength (messageLength), mFrequencyTable (begin, end), mCumulativeFrequencyTable ()
174+ SymbolStatistics::SymbolStatistics (const IT begin, const IT end, int64_t min, int64_t max, size_t messageLength) : mMin (min), mMax (max), mNUsedAlphabetSymbols (0 ), mMessageLength (messageLength), mFrequencyTable (begin, end), mCumulativeFrequencyTable ()
175175{
176176 LOG (trace) << " start loading external symbol statistics" ;
177177 for (auto i : mFrequencyTable ) {
@@ -193,7 +193,7 @@ void SymbolStatistics::buildFrequencyTable(const IT begin, const IT end,
193193 // find min_ and max_
194194 const auto minmax = std::minmax_element (begin, end);
195195
196- if (range > 0 ) {
196+ if (range > 0 ) { // FIXME: providing the range will work only for data [0 : (1 << range) - 1]
197197 mMin = 0 ;
198198 mMax = (1 << range) - 1 ;
199199
0 commit comments