forked from Kingsford-Group/bloomtree
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathPREQ_INSTALL.sdsl-lite.patch
58 lines (55 loc) · 1.83 KB
/
PREQ_INSTALL.sdsl-lite.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
diff --git a/include/sdsl/int_vector.hpp b/include/sdsl/int_vector.hpp
index c6d4114..90568b7 100644
--- a/include/sdsl/int_vector.hpp
+++ b/include/sdsl/int_vector.hpp
@@ -541,6 +541,15 @@ class int_vector
//! Greater of equal operator
bool operator>=(const int_vector& v) const;
+ //! bitwise-and-update operator
+ int_vector& operator&=(const int_vector& v);
+
+ //! bitwise-or-update equal operator
+ int_vector& operator|=(const int_vector& v);
+
+ //! bitwise-xor-update operator
+ int_vector& operator^=(const int_vector& v);
+
//! Iterator that points to the first element of the int_vector.
/*! Time complexity guaranty is O(1).
*/
@@ -1504,6 +1513,36 @@ bool int_vector<t_width>::operator!=(const int_vector& v)const
}
template<uint8_t t_width>
+int_vector<t_width>& int_vector<t_width>::operator&=(const int_vector& v)
+{
+ assert(bit_size() == v.bit_size());
+ assert(v.capacity() <= capacity());
+ for (uint64_t i=0; i<(v.capacity()>>6); ++i)
+ m_data[i] &= v.m_data[i];
+ return *this;
+}
+
+template<uint8_t t_width>
+int_vector<t_width>& int_vector<t_width>::operator|=(const int_vector& v)
+{
+ assert(bit_size() == v.bit_size());
+ assert(v.capacity() <= capacity());
+ for (uint64_t i=0; i<(v.capacity()>>6); ++i)
+ m_data[i] |= v.m_data[i];
+ return *this;
+}
+
+template<uint8_t t_width>
+int_vector<t_width>& int_vector<t_width>::operator^=(const int_vector& v)
+{
+ assert(bit_size() == v.bit_size());
+ assert(v.capacity() <= capacity());
+ for (uint64_t i=0; i<(v.capacity()>>6); ++i)
+ m_data[i] ^= v.m_data[i];
+ return *this;
+}
+
+template<uint8_t t_width>
typename int_vector<t_width>::size_type int_vector<t_width>::write_data(std::ostream& out) const
{
size_type written_bytes = 0;