diff options
| author | mzuenni <michi.zuendorf@gmail.com> | 2024-08-30 15:04:20 +0200 |
|---|---|---|
| committer | mzuenni <michi.zuendorf@gmail.com> | 2024-08-30 15:04:20 +0200 |
| commit | ac2d9ad3f2c88bc12420fc439e8d0b4775a11169 (patch) | |
| tree | 256c13ae0a321e3a705bde52ee679131b9f864d5 /content/other/bitOps.cpp | |
| parent | 00b01a954304e50904de97b25639c535e16f259e (diff) | |
various small improvements
Diffstat (limited to 'content/other/bitOps.cpp')
| -rw-r--r-- | content/other/bitOps.cpp | 7 |
1 files changed, 0 insertions, 7 deletions
diff --git a/content/other/bitOps.cpp b/content/other/bitOps.cpp index 8079305..6230c86 100644 --- a/content/other/bitOps.cpp +++ b/content/other/bitOps.cpp @@ -3,13 +3,6 @@ for (int subset = bitmask; subset > 0; subset = (subset - 1) & bitmask) -// Zählt Anzahl der gesetzten Bits. -int numberOfSetBits(int i) { - i = i - ((i >> 1) & 0x5555'5555); - i = (i & 0x3333'3333) + ((i >> 2) & 0x3333'3333); - return (((i + (i >> 4)) & 0x0F0F'0F0F) * 0x0101'0101) >> 24; -} - // Nächste Permutation in Bitmaske // (z.B. 00111 => 01011 => 01101 => ...) ll nextPerm(ll v) { |
