14#ifndef OR_TOOLS_BASE_BITMAP_H_
15#define OR_TOOLS_BASE_BITMAP_H_
23inline uint64_t
OneBit64(
int pos) {
return uint64_t{1} << pos; }
24inline uint64_t
BitPos64(uint64_t pos) {
return (pos & 63); }
25inline uint64_t
BitOffset64(uint64_t pos) {
return (pos >> 6); }
27inline bool IsBitSet64(
const uint64_t*
const bitset, uint64_t pos) {
30inline void SetBit64(uint64_t*
const bitset, uint64_t pos) {
33inline void ClearBit64(uint64_t*
const bitset, uint64_t pos) {
45 map_(new uint64_t[array_size_]) {
59 assert(max_size_ == 0 ||
index < max_size_);
63 assert(max_size_ == 0 ||
index < max_size_);
73 memset(map_, (
value ? 0xFF : 0x00), array_size_ *
sizeof(*map_));
void Resize(uint32_t size, bool fill=false)
~Bitmap()
Destructor: clean up.
bool Get(uint32_t index) const
void Set(uint32_t index, bool value)
Bitmap(uint32_t size, bool fill=false)
void Clear()
Clears all bits in the bitmap.
void SetAll(bool value)
Sets all the bits to true or false.
void SetBit64(uint64_t *const bitset, uint64_t pos)
uint64_t BitLength64(uint64_t size)
uint64_t OneBit64(int pos)
uint64_t BitPos64(uint64_t pos)
bool IsBitSet64(const uint64_t *const bitset, uint64_t pos)
void ClearBit64(uint64_t *const bitset, uint64_t pos)
uint64_t BitOffset64(uint64_t pos)
In SWIG mode, we don't want anything besides these top-level includes.
uint64_t BitLength64(uint64_t size)
Returns the number of words needed to store size bits.