summaryrefslogtreecommitdiff
path: root/src/util/bitvector.h
diff options
context:
space:
mode:
authorTim King <taking@cs.nyu.edu>2012-02-15 21:52:16 +0000
committerTim King <taking@cs.nyu.edu>2012-02-15 21:52:16 +0000
commit9a0a59d5c85c4a1d2469f43e9d2b433e156810ba (patch)
treeba66b1c5cdeec062ce4144a463ec0b61a83e3cc6 /src/util/bitvector.h
parent093fa1757392e7bfc18493f2daa87ff540aeea86 (diff)
This commit merges into trunk the branch branches/arithmetic/integers2 from r2650 to r2779.
- This excludes revision 2777. This revision had some strange performance implications and was delaying the merge. - This includes the new DioSolver. The DioSolver can discover conflicts, produce substitutions, and produce cuts. - The DioSolver can be disabled at command line using --disable-dio-solver. - This includes a number of changes to the arithmetic normal form. - The Integer class features a number of new number theoretic function. - This commit includes a few rather loud warning. I will do my best to take care of them today.
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