tesseract 4.1.1
Loading...
Searching...
No Matches
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 57 of file bitvec.h.

◆ SET_BIT

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

Definition at line 55 of file bitvec.h.

◆ test_bit

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

Definition at line 59 of file bitvec.h.

Typedef Documentation

◆ BIT_VECTOR

using BIT_VECTOR = uint32_t*

Definition at line 28 of file bitvec.h.

Variable Documentation

◆ BITSINLONG

const size_t BITSINLONG = 8 * sizeof(uint32_t)

Definition at line 31 of file bitvec.h.