Gromacs  2019
 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:

Description

Declares gmx_bitmask_t and associated functions.

Author
Roland Schulz rolan.nosp@m.d@ut.nosp@m.k.edu

Macros

#define BITMASK_SIZE   GMX_OPENMP_MAX_THREADS
 Size of bitmask. Has to be 32 or multiple of 64.
 

Typedefs

typedef uint64_t gmx_bitmask_t
 bitmask type
 

Functions

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.