#include <llvmexpr/analysis/utils/DynamicBitset.hpp>
Definition at line 29 of file DynamicBitset.hpp.
◆ DynamicBitset()
| analysis::dynamic_bitset::DynamicBitset::DynamicBitset |
( |
int | n = 0 | ) |
|
|
inlineexplicit |
◆ equals()
| bool analysis::dynamic_bitset::DynamicBitset::equals |
( |
const DynamicBitset & | other | ) |
const |
|
inlinenodiscardnoexcept |
◆ intersectWith()
| bool analysis::dynamic_bitset::DynamicBitset::intersectWith |
( |
const DynamicBitset & | other | ) |
|
|
inlinenoexcept |
Definition at line 78 of file DynamicBitset.hpp.
78 {
79 bool changed = false;
80
81 if (other.words.size() == words.size()) {
82 for (size_t i = 0; i < words.size(); ++i) {
83 const std::uint64_t nw = words[i] & other.words[i];
84 changed |= (nw != words[i]);
85 words[i] = nw;
86 }
87 maskUnusedBits();
88 return changed;
89 }
90
91 const size_t n = std::min(words.size(), other.words.size());
92 for (size_t i = 0; i < n; ++i) {
93 const std::uint64_t nw = words[i] & other.words[i];
94 changed |= (nw != words[i]);
95 words[i] = nw;
96 }
97 for (size_t i = n; i < words.size(); ++i) {
98 changed |= (words[i] != 0);
99 words[i] = 0;
100 }
101 maskUnusedBits();
102 return changed;
103 }
References DynamicBitset().
◆ reset()
| void analysis::dynamic_bitset::DynamicBitset::reset |
( |
int | i | ) |
|
|
inlinenoexcept |
Definition at line 67 of file DynamicBitset.hpp.
67 {
68 words[static_cast<size_t>(i) / BITS_PER_WORD] &=
69 ~(std::uint64_t(1) << static_cast<unsigned>(i % BITS_PER_WORD));
70 }
◆ resetAll()
| void analysis::dynamic_bitset::DynamicBitset::resetAll |
( |
| ) |
|
|
inlinenoexcept |
◆ set()
| void analysis::dynamic_bitset::DynamicBitset::set |
( |
int | i | ) |
|
|
inlinenoexcept |
Definition at line 62 of file DynamicBitset.hpp.
62 {
63 words[static_cast<size_t>(i) / BITS_PER_WORD] |=
64 (std::uint64_t(1) << static_cast<unsigned>(i % BITS_PER_WORD));
65 }
◆ setAll()
| void analysis::dynamic_bitset::DynamicBitset::setAll |
( |
| ) |
|
|
inlinenoexcept |
Definition at line 55 of file DynamicBitset.hpp.
55 {
56 std::ranges::fill(words, ~std::uint64_t(0));
57 maskUnusedBits();
58 }
◆ test()
| bool analysis::dynamic_bitset::DynamicBitset::test |
( |
int | i | ) |
const |
|
inlinenodiscardnoexcept |
Definition at line 72 of file DynamicBitset.hpp.
72 {
73 return (((words[static_cast<size_t>(i) / BITS_PER_WORD] >>
74 static_cast<unsigned>(i % BITS_PER_WORD)) &
75 1U) != 0);
76 }
The documentation for this class was generated from the following file: