Storm
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
bitoperations.h File Reference
#include <cstdint>
#include "storm/utility/macros.h"
Include dependency graph for bitoperations.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

uint64_t smallestIntWithNBitsSet (uint64_t n)
 
uint64_t nextBitPermutation (uint64_t v)
 The next bit permutation in a lexicographical sense.
 

Function Documentation

◆ nextBitPermutation()

uint64_t nextBitPermutation ( uint64_t  v)
inline

The next bit permutation in a lexicographical sense.

Example: 00010011, 00010101, 00010110, 00011001, 00011010, 00011100, 00100011, and so forth

From https://graphics.stanford.edu/~seander/bithacks.html#NextBitPermutation

Definition at line 24 of file bitoperations.h.

◆ smallestIntWithNBitsSet()

uint64_t smallestIntWithNBitsSet ( uint64_t  n)
inline
Returns
2^n - 1

Definition at line 9 of file bitoperations.h.