fix a recent bug in StatesIndexer.h

This commit is contained in:
Tiago Gomes 2012-05-25 14:36:52 +01:00
parent a56bccf5e5
commit df8a3c5fdc

View File

@ -20,7 +20,8 @@ class StatesIndexer
StatesIndexer (const Ranges& ranges, bool calcOffsets = true) StatesIndexer (const Ranges& ranges, bool calcOffsets = true)
{ {
li_ = 0; li_ = 0;
size_ = std::accumulate (ranges.begin(), ranges.end(), 0); size_ = std::accumulate (ranges.begin(), ranges.end(), 1,
std::multiplies<unsigned>());
indices_.resize (ranges.size(), 0); indices_.resize (ranges.size(), 0);
ranges_ = ranges; ranges_ = ranges;
if (calcOffsets) { if (calcOffsets) {