summaryrefslogtreecommitdiff
path: root/src/util/integer_gmp_imp.h
diff options
context:
space:
mode:
authorAina Niemetz <aina.niemetz@gmail.com>2020-09-30 17:26:46 -0700
committerGitHub <noreply@github.com>2020-09-30 17:26:46 -0700
commitd7f92f70bb8ff221dc3d7cb086e5e2e237dadc67 (patch)
tree26916ced6f98142dd9dc04c454ff6d0c8161a8d6 /src/util/integer_gmp_imp.h
parentaa65c60968d0b8c0a7cd47adb2e9e1a684c0332a (diff)
BitVector: Extend interface of setBit to set it to a specific value. (#5173)
Previously, BitVector::setBit only allowed to set the bit at the given index to 1. This changes its behavior to be also able to set it to 0.
Diffstat (limited to 'src/util/integer_gmp_imp.h')
-rw-r--r--src/util/integer_gmp_imp.h7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/util/integer_gmp_imp.h b/src/util/integer_gmp_imp.h
index 33e0d5ebd..e7c0ee3a4 100644
--- a/src/util/integer_gmp_imp.h
+++ b/src/util/integer_gmp_imp.h
@@ -165,12 +165,7 @@ class CVC4_PUBLIC Integer
* Returns the Integer obtained by setting the ith bit of the
* current Integer to 1.
*/
- Integer setBit(uint32_t i) const
- {
- mpz_class res = d_value;
- mpz_setbit(res.get_mpz_t(), i);
- return Integer(res);
- }
+ Integer setBit(uint32_t i, bool value) const;
bool isBitSet(uint32_t i) const { return !extractBitRange(1, i).isZero(); }
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback