Painless
A framework to ease parallelization of sequential CDCL SAT solvers
Loading...
Searching...
No Matches
bitset.hpp
1#ifndef BITSET_H_
2#define BITSET_H_
3#include <iostream>
4#include <limits>
5#include <random>
6typedef unsigned long long ull;
7
8class Bitset
9{
10 public:
11 static const ull size_correcter = 1ull;
12 static const ull one_bit = 1ull;
13 static const ull zero_bit = 0ull;
14 int bits = 8 * sizeof(ull);
15 int m_size = 0, n = 0;
16 ull *array, hashval;
17 void print();
18 void hash() noexcept;
19 void allocate(int sz) noexcept;
20 void random() noexcept;
21 void free() noexcept;
22 void eqs(const Bitset& u, int s) noexcept;
23 void ands(const Bitset& u, const Bitset& v, int s, int s1, int s2) noexcept;
24 void xors(const Bitset& u, const Bitset& v, int s, int s1, int s2) noexcept;
25
26 bool operator==(const Bitset& rhs) const noexcept;
27
28 constexpr int size() const noexcept;
29
30 void set() noexcept;
31 Bitset& set(int);
32 void reset() noexcept;
33 Bitset& reset(int);
34 Bitset& flip() noexcept;
35
36 Bitset& operator=(const Bitset& other) noexcept;
37 Bitset operator~() const noexcept;
38 int operator[](int) noexcept;
39};
40
41#endif
A class representing a bitset with dynamic size.
Definition Bitset.hpp:14
size_t size() const
Get the size of the bitset.
Definition Bitset.hpp:93