29#include "../common/constants.h"
33typedef struct _bit_set_t {
52 for (
unsigned int i = 0; i < b->
n_words; i++) {
72 uint32_t *
data = (uint32_t *)
MALLOC(n_words *
sizeof(uint32_t));
107 unsigned int bit = 1 << (i & 31);
110 b->_data[word] |= bit;
128 uint32_t bit = 1 << (i & 31);
129 return (
bool) (b->_data[word] & bit);
141 unsigned int word = i >> 5;
142 unsigned int bit = 1 << (i & 0x1f);
148 b->_data[word] &= ~bit;
158 log_debug(
"%d,%c", offset + i, ((e & 0x1) == 0) ?
' ' :
'1');
168 for (
int i = s; i > 0; i--) {
178 for (
int i = s; i > 0; i--) {
bool bit_set_clear(bit_set_t *b)
Empty a bitset entirely.
static bool bit_set_add(bit_set_t *b, unsigned int i)
Add an element to a bitset.
unsigned int count
Keep track of members.
static void print_bit_field_entry_v2(uint32_t e, int offset)
This function prints out an individual word of a bit_field, as a sequence of ones and zeros.
unsigned int n_elements
Number of elements which may be in the set.
static bool bit_set_contains(bit_set_t *b, unsigned int i)
Test if an element is in a bitset.
void print_bit_set(bit_set_t b)
prints a bit set
void print_bit_field_bits_v2(bit_field_t b, size_t s)
This function prints out an entire bit_field, as a sequence of ones and zeros.
static bool bit_set_remove(bit_set_t *b, unsigned int i)
Remove an element from a bitset.
void print_bit_set_bits(bit_field_t b, int s)
This function prints out an entire bit_field, as a sequence of ones and zeros.
static bool bit_set_init(bit_set_t *b, unsigned int length)
Create a new bitset.
static void bit_set_delete(bit_set_t *b)
Destroy a bitset.
unsigned int n_words
Number of words in _data.
#define BITS_IN_A_WORD
bits in a word
static uint32_t data[ITEMS_PER_DATA_PACKET]
SpiNNaker debug header file.
void log_debug(const char *message,...)
This function logs debugging messages. This level of message is normally not printed except when the ...