OR-Tools  8.2
UnsortedNullableRevBitset

Detailed Description

This class represents a reversible bitset.

It is meant to represent a set of active bits. It does not offer direct access, but just methods that can reversibly subtract another bitset, or check if the current active bitset intersects with another bitset.

Definition at line 2775 of file constraint_solveri.h.

Public Member Functions

 UnsortedNullableRevBitset (int bit_size)
 Size is the number of bits to store in the bitset. More...
 
 ~UnsortedNullableRevBitset ()
 
void Init (Solver *const solver, const std::vector< uint64 > &mask)
 This methods overwrites the active bitset with the mask. More...
 
bool RevSubtract (Solver *const solver, const std::vector< uint64 > &mask)
 This method subtracts the mask from the active bitset. More...
 
bool RevAnd (Solver *const solver, const std::vector< uint64 > &mask)
 This method ANDs the mask with the active bitset. More...
 
int ActiveWordSize () const
 This method returns the number of non null 64 bit words in the bitset representation. More...
 
bool Empty () const
 This method returns true if the active bitset is null. More...
 
bool Intersects (const std::vector< uint64 > &mask, int *support_index)
 This method returns true iff the mask and the active bitset have a non null intersection. More...
 
int64 bit_size () const
 Returns the number of bits given in the constructor of the bitset. More...
 
int64 word_size () const
 Returns the number of 64 bit words used to store the bitset. More...
 
const RevIntSet< int > & active_words () const
 Returns the set of active word indices. More...
 

Constructor & Destructor Documentation

◆ UnsortedNullableRevBitset()

UnsortedNullableRevBitset ( int  bit_size)
explicit

Size is the number of bits to store in the bitset.

Definition at line 221 of file utilities.cc.

◆ ~UnsortedNullableRevBitset()

Definition at line 2780 of file constraint_solveri.h.

Member Function Documentation

◆ active_words()

const RevIntSet<int>& active_words ( ) const
inline

Returns the set of active word indices.

Definition at line 2815 of file constraint_solveri.h.

◆ ActiveWordSize()

int ActiveWordSize ( ) const
inline

This method returns the number of non null 64 bit words in the bitset representation.

Definition at line 2796 of file constraint_solveri.h.

◆ bit_size()

int64 bit_size ( ) const
inline

Returns the number of bits given in the constructor of the bitset.

Definition at line 2811 of file constraint_solveri.h.

◆ Empty()

bool Empty ( ) const
inline

This method returns true if the active bitset is null.

Definition at line 2799 of file constraint_solveri.h.

◆ Init()

void Init ( Solver *const  solver,
const std::vector< uint64 > &  mask 
)

This methods overwrites the active bitset with the mask.

This method should be called only once.

Definition at line 227 of file utilities.cc.

◆ Intersects()

bool Intersects ( const std::vector< uint64 > &  mask,
int *  support_index 
)

This method returns true iff the mask and the active bitset have a non null intersection.

support_index is used as an accelerator:

  • The first word tested to check the intersection will be the '*support_index'th one.
  • If the intersection is not null, the support_index will be filled with the index of the word that does intersect with the mask. This can be reused later to speed-up the check.

Definition at line 290 of file utilities.cc.

◆ RevAnd()

bool RevAnd ( Solver *const  solver,
const std::vector< uint64 > &  mask 
)

This method ANDs the mask with the active bitset.

It returns true if the active bitset was changed in the process.

Definition at line 265 of file utilities.cc.

◆ RevSubtract()

bool RevSubtract ( Solver *const  solver,
const std::vector< uint64 > &  mask 
)

This method subtracts the mask from the active bitset.

It returns true if the active bitset was changed in the process.

Definition at line 238 of file utilities.cc.

◆ word_size()

int64 word_size ( ) const
inline

Returns the number of 64 bit words used to store the bitset.

Definition at line 2813 of file constraint_solveri.h.


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