diff --git a/src/storage/BitVector.cpp b/src/storage/BitVector.cpp index 9547d919b..0dcc3cbec 100644 --- a/src/storage/BitVector.cpp +++ b/src/storage/BitVector.cpp @@ -41,6 +41,13 @@ namespace storm { return *this; } + BitVector::const_iterator& BitVector::const_iterator::operator+=(size_t n) { + for(size_t i = 0; i < n; ++i) { + currentIndex = getNextSetIndex(dataPtr, ++currentIndex, endIndex); + } + return *this; + } + uint_fast64_t BitVector::const_iterator::operator*() const { return currentIndex; } diff --git a/src/storage/BitVector.h b/src/storage/BitVector.h index d52f07427..8aed9e387 100644 --- a/src/storage/BitVector.h +++ b/src/storage/BitVector.h @@ -58,6 +58,12 @@ namespace storm { * @return A reference to this iterator. */ const_iterator& operator++(); + + /*! + * Increases the position of the iterator to the position of the n'th next bit that is set to true in the + * underlying bit vector. + */ + const_iterator& operator+=(size_t n); /*! * Returns the index of the current bit to which this iterator points.