Browse Source

BitVector iterator +=

Former-commit-id: d9e02bce1a
main
sjunges 10 years ago
parent
commit
0cdca6a5fc
  1. 7
      src/storage/BitVector.cpp
  2. 6
      src/storage/BitVector.h

7
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;
}

6
src/storage/BitVector.h

@ -59,6 +59,12 @@ namespace storm {
*/
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.
*

|||||||
100:0
Loading…
Cancel
Save