ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE-3.0/src/utils/BitSet.cpp
(Generate patch)

Comparing trunk/OOPSE-3.0/src/utils/BitSet.cpp (file contents):
Revision 1970 by tim, Fri Feb 4 05:42:30 2005 UTC vs.
Revision 1980 by tim, Mon Feb 7 19:13:43 2005 UTC

# Line 42 | Line 42
42   #include "utils/BitSet.hpp"
43   #include <algorithm>
44   #include <cassert>
45 <
45 > #include <string>
46   namespace oopse {
47   int BitSet::countBits() {
48      return std::count(bitset_.begin(), bitset_.end(), true);
# Line 76 | Line 76 | int BitSet::nextOffBit(int fromIndex) {
76      return i == bitset_.end() ? true : false;
77   }
78      
79 < int BitSet::nextOffBit(int fromIndex) {
79 > int BitSet::nextOffBit(int fromIndex) const {
80      ++fromIndex;
81      while (fromIndex < size()) {
82          if (!bitset_[fromIndex]) {
# Line 88 | Line 88 | int BitSet::nextOnBit(int fromIndex) {
88      return -1;
89   }
90  
91 < int BitSet::nextOnBit(int fromIndex) {
91 > int BitSet::nextOnBit(int fromIndex) const {
92      ++fromIndex;
93      while (fromIndex < size()) {
94          if (bitset_[fromIndex]) {
# Line 168 | Line 168 | std::ostream& operator<< ( std::ostream& os, const Bit
168   }
169  
170   std::ostream& operator<< ( std::ostream& os, const BitSet& bs) {
171 +    for (int i = 0; i < bs.bitset_.size(); ++i) {
172 +        std::string val = bs[i] ? "true" : "false";
173 +        os << "BitSet[" << i <<"] = " << val << std::endl;
174 +    }
175 +    
176      return os;
177   }
178  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines