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

#include <constraint_solveri.h>

Inheritance diagram for operations_research::RevBitSet:
operations_research::RevBitMatrix

Public Member Functions

 RevBitSet (int64_t size)
 -------— RevBitSet -------—
 
 ~RevBitSet ()
 
void SetToOne (Solver *solver, int64_t index)
 Sets the 'index' bit.
 
void SetToZero (Solver *solver, int64_t index)
 Erases the 'index' bit.
 
bool IsSet (int64_t index) const
 Returns whether the 'index' bit is set.
 
int64_t Cardinality () const
 Returns the number of bits set to one.
 
bool IsCardinalityZero () const
 Is bitset null?
 
bool IsCardinalityOne () const
 Does it contains only one bit set?
 
int64_t GetFirstBit (int start) const
 
void ClearAll (Solver *solver)
 Cleans all bits.
 

Friends

class RevBitMatrix
 

Detailed Description

This class represents a reversible bitset. This class is useful to maintain supports.

Definition at line 433 of file constraint_solveri.h.

Constructor & Destructor Documentation

◆ RevBitSet()

operations_research::RevBitSet::RevBitSet ( int64_t size)
explicit

-------— RevBitSet -------—

Definition at line 62 of file utilities.cc.

◆ ~RevBitSet()

operations_research::RevBitSet::~RevBitSet ( )

Definition at line 72 of file utilities.cc.

Member Function Documentation

◆ Cardinality()

int64_t operations_research::RevBitSet::Cardinality ( ) const

Returns the number of bits set to one.

Definition at line 113 of file utilities.cc.

◆ ClearAll()

void operations_research::RevBitSet::ClearAll ( Solver * solver)

Cleans all bits.

Definition at line 152 of file utilities.cc.

◆ GetFirstBit()

int64_t operations_research::RevBitSet::GetFirstBit ( int start) const

Gets the index of the first bit set starting from start. It returns -1 if the bitset is empty after start.

Definition at line 148 of file utilities.cc.

◆ IsCardinalityOne()

bool operations_research::RevBitSet::IsCardinalityOne ( ) const

Does it contains only one bit set?

Definition at line 130 of file utilities.cc.

◆ IsCardinalityZero()

bool operations_research::RevBitSet::IsCardinalityZero ( ) const

Is bitset null?

Definition at line 121 of file utilities.cc.

◆ IsSet()

bool operations_research::RevBitSet::IsSet ( int64_t index) const

Returns whether the 'index' bit is set.

Definition at line 107 of file utilities.cc.

◆ SetToOne()

void operations_research::RevBitSet::SetToOne ( Solver * solver,
int64_t index )

Sets the 'index' bit.

Definition at line 85 of file utilities.cc.

◆ SetToZero()

void operations_research::RevBitSet::SetToZero ( Solver * solver,
int64_t index )

Erases the 'index' bit.

Definition at line 96 of file utilities.cc.

Friends And Related Symbol Documentation

◆ RevBitMatrix

friend class RevBitMatrix
friend

Definition at line 456 of file constraint_solveri.h.


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