Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
operations_research::Bitmap Class Reference

#include <bitmap.h>

Public Member Functions

 Bitmap (uint32_t size, bool fill=false)
 
 ~Bitmap ()
 Destructor: clean up.
 
void Resize (uint32_t size, bool fill=false)
 
bool Get (uint32_t index) const
 
void Set (uint32_t index, bool value)
 
void SetAll (bool value)
 Sets all the bits to true or false.
 
void Clear ()
 Clears all bits in the bitmap.
 

Detailed Description

Definition at line 38 of file bitmap.h.

Constructor & Destructor Documentation

◆ Bitmap()

operations_research::Bitmap::Bitmap ( uint32_t size,
bool fill = false )
inlineexplicit

Constructor : This allocates on a uint32_t boundary. fill: true = initialize with 1's, false = initialize with 0's.

initialize all of the bits

Definition at line 42 of file bitmap.h.

◆ ~Bitmap()

operations_research::Bitmap::~Bitmap ( )
inline

Destructor: clean up.

Definition at line 51 of file bitmap.h.

Member Function Documentation

◆ Clear()

void operations_research::Bitmap::Clear ( )
inline

Clears all bits in the bitmap.

Definition at line 77 of file bitmap.h.

◆ Get()

bool operations_research::Bitmap::Get ( uint32_t index) const
inline

Definition at line 58 of file bitmap.h.

◆ Resize()

void operations_research::Bitmap::Resize ( uint32_t size,
bool fill = false )

Resizes the bitmap. If size < bits(), the extra bits will be discarded. If size > bits(), the extra bits will be filled with the fill value.

Todo
(user) : optimize next loop.

Definition at line 20 of file bitmap.cc.

◆ Set()

void operations_research::Bitmap::Set ( uint32_t index,
bool value )
inline

Definition at line 62 of file bitmap.h.

◆ SetAll()

void operations_research::Bitmap::SetAll ( bool value)
inline

Sets all the bits to true or false.

Definition at line 72 of file bitmap.h.


The documentation for this class was generated from the following files: