Empirical
Namespaces | Functions | Variables
bitset_utils.h File Reference

A set of simple functions to manipulate bitsets. More...

#include "functions.h"

Go to the source code of this file.

Namespaces

 emp
 If we are in emscripten, make sure to include the header.
 

Functions

template<int NUM_BITS>
constexpr uint32_t emp::UIntMaskFirst ()
 Create a series of a specified number of ones (at compile time) in a uint. More...
 
template<>
constexpr uint32_t emp::UIntMaskFirst< 0 > ()
 Create an empty bit mask (all zeros) More...
 
constexpr size_t emp::count_bits (uint64_t val)
 Count the number of bits in a 64-bit unsigned integer. More...
 
constexpr size_t emp::count_bits (uint32_t val)
 Count the number of bits in a 32-bit unsigned integer. More...
 
constexpr size_t emp::find_bit (const uint64_t &val)
 Return the position of the first one bit (in a 64-bit unsigned int) More...
 
constexpr size_t emp::find_bit (const uint32_t &val)
 Return the position of the first one bit (in a 32-bit unsigned int) More...
 

Variables

constexpr size_t emp::ByteCount [256]
 How many bits are set to one in each possible byte? More...
 

Detailed Description

A set of simple functions to manipulate bitsets.

Note
This file is part of Empirical, https://github.com/devosoft/Empirical
Date
2016-2017
Note
Status: BETA