summaryrefslogtreecommitdiff
path: root/src/util/bitvector.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/bitvector.h')
-rw-r--r--src/util/bitvector.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/util/bitvector.h b/src/util/bitvector.h
index f05ebaf17..d7f0e13a5 100644
--- a/src/util/bitvector.h
+++ b/src/util/bitvector.h
@@ -91,15 +91,18 @@ public:
}
BitVector operator ~() const {
+ //is this right? it looks like a no-op?
return BitVector(d_size, d_value);
}
BitVector concat (const BitVector& other) const {
- return BitVector(d_size + other.d_size, (d_value * Integer(2).pow(other.d_size)) + other.d_value);
+ return BitVector(d_size + other.d_size, (d_value.multiplyByPow2(other.d_size)) + other.d_value);
+ //return BitVector(d_size + other.d_size, (d_value * Integer(2).pow(other.d_size)) + other.d_value);
}
BitVector extract(unsigned high, unsigned low) const {
- return BitVector(high - low + 1, (d_value % (Integer(2).pow(high + 1))) / Integer(2).pow(low));
+ return BitVector(high - low + 1, d_value.extractBitRange(high - low + 1, low));
+ //return BitVector(high - low + 1, (d_value % (Integer(2).pow(high + 1))) / Integer(2).pow(low));
}
size_t hash() const {
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback