Gromacs  2021-beta2-UNCHECKED
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Macros | Typedefs | Functions
bitmask.h File Reference
#include "config.h"
#include <string.h>
#include <algorithm>
#include <array>
#include "gromacs/utility/basedefinitions.h"
#include "gromacs/utility/stringutil.h"
+ Include dependency graph for bitmask.h:
+ This graph shows which files directly or indirectly include this file:


Declares gmx_bitmask_t and associated functions.

Roland Schulz


 Size of bitmask. Has to be 32 or multiple of 64.


typedef uint64_t gmx_bitmask_t
 bitmask type


static void bitmask_clear (gmx_bitmask_t *m)
 Initialize all bits to 0.
static void bitmask_set_bit (gmx_bitmask_t *m, int b)
 Set bit at position b to 1.
static void bitmask_init_bit (gmx_bitmask_t *m, int b)
 Initialize all bits: bit b to 1, others to 0.
static void bitmask_init_low_bits (gmx_bitmask_t *m, int b)
 Initialize all bits: all bits below b to 1, others to 0.
static bool bitmask_is_set (gmx_bitmask_t m, int b)
 Test if bit b is set.
static bool bitmask_is_disjoint (gmx_bitmask_t a, gmx_bitmask_t b)
 Test if both bitmasks have no common bits enabled.
static bool bitmask_is_equal (gmx_bitmask_t a, gmx_bitmask_t b)
 Test if both bitmasks are equal.
static bool bitmask_is_zero (gmx_bitmask_t m)
 Test if bitmask has no enabled bits.
static void bitmask_union (gmx_bitmask_t *a, gmx_bitmask_t b)
 Set all bits enabled in either mask and write into a.
static std::string to_hex_string (uint32_t m)
 Convert uint32_t to hex string.
static std::string to_hex_string (uint64_t m)
 Convert uint64_t to hex string.
template<typename C >
static std::string to_hex_string (C m)
 Convert container of intergers to hex string.