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

Detailed Description

Specialized version of Bitset64 that allows to query the last bit set more efficiently.

Definition at line 748 of file bitset.h.

#include <bitset.h>

Public Member Functions

 BitQueue64 ()
 BitQueue64 (int size)
 BitQueue64 (const BitQueue64 &)=delete
 This type is neither copyable nor movable.
BitQueue64operator= (const BitQueue64 &)=delete
void IncreaseSize (int size)
void ClearAndResize (int size)
void Set (int i)
void SetAllBefore (int i)
 Sets all the bits from 0 up to i-1 to 1.
int Top () const
 Returns the position of the highest bit set in O(1) or -1 if no bit is set.
void ClearTop ()
 Clears the Top() bit and recomputes the position of the next Top().

Constructor & Destructor Documentation

◆ BitQueue64() [1/3]

operations_research::BitQueue64::BitQueue64 ( )
inline

Definition at line 750 of file bitset.h.

◆ BitQueue64() [2/3]

operations_research::BitQueue64::BitQueue64 ( int size)
inlineexplicit

Definition at line 751 of file bitset.h.

◆ BitQueue64() [3/3]

operations_research::BitQueue64::BitQueue64 ( const BitQueue64 & )
delete

This type is neither copyable nor movable.

Member Function Documentation

◆ ClearAndResize()

void operations_research::BitQueue64::ClearAndResize ( int size)
inline

Definition at line 764 of file bitset.h.

◆ ClearTop()

void operations_research::BitQueue64::ClearTop ( )
inline

Clears the Top() bit and recomputes the position of the next Top().

Note(user): I experimented with reversing the bit order in a bucket to use LeastSignificantBitPosition64() and it is only slightly faster at the cost of a lower Set() speed. So I preferred this version.

Definition at line 793 of file bitset.h.

◆ IncreaseSize()

void operations_research::BitQueue64::IncreaseSize ( int size)
inline

Definition at line 758 of file bitset.h.

◆ operator=()

BitQueue64 & operations_research::BitQueue64::operator= ( const BitQueue64 & )
delete

◆ Set()

void operations_research::BitQueue64::Set ( int i)
inline

Definition at line 770 of file bitset.h.

◆ SetAllBefore()

void operations_research::BitQueue64::SetAllBefore ( int i)
inline

Sets all the bits from 0 up to i-1 to 1.

Definition at line 778 of file bitset.h.

◆ Top()

int operations_research::BitQueue64::Top ( ) const
inline

Returns the position of the highest bit set in O(1) or -1 if no bit is set.

Definition at line 790 of file bitset.h.


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