tesseract  5.0.0-alpha-619-ge9db
bitvec.h File Reference
#include <cstddef>
#include <cstdint>

Go to the source code of this file.

Macros

#define SET_BIT(array, bit)   (array[bit/BITSINLONG]|=1<<(bit&(BITSINLONG-1)))
 
#define reset_bit(array, bit)   (array[bit/BITSINLONG]&=~(1<<(bit&(BITSINLONG-1))))
 
#define test_bit(array, bit)   (array[bit/BITSINLONG] & (1<<(bit&(BITSINLONG-1))))
 

Typedefs

using BIT_VECTOR = uint32_t *
 

Variables

const size_t BITSINLONG = 8 * sizeof(uint32_t)
 

Macro Definition Documentation

◆ reset_bit

#define reset_bit (   array,
  bit 
)    (array[bit/BITSINLONG]&=~(1<<(bit&(BITSINLONG-1))))

Definition at line 56 of file bitvec.h.

◆ SET_BIT

#define SET_BIT (   array,
  bit 
)    (array[bit/BITSINLONG]|=1<<(bit&(BITSINLONG-1)))

Definition at line 54 of file bitvec.h.

◆ test_bit

#define test_bit (   array,
  bit 
)    (array[bit/BITSINLONG] & (1<<(bit&(BITSINLONG-1))))

Definition at line 58 of file bitvec.h.

Typedef Documentation

◆ BIT_VECTOR

using BIT_VECTOR = uint32_t*

Definition at line 27 of file bitvec.h.

Variable Documentation

◆ BITSINLONG

const size_t BITSINLONG = 8 * sizeof(uint32_t)

Definition at line 30 of file bitvec.h.