Public Member Functions | List of all members
operations_research::SmallRevBitSet Class Reference

This class represents a small reversible bitset (size <= 64). More...

#include <constraint_solveri.h>

Public Member Functions

 SmallRevBitSet (int64 size)
 
void SetToOne (Solver *const solver, int64 pos)
 Sets the 'pos' bit. More...
 
void SetToZero (Solver *const solver, int64 pos)
 Erases the 'pos' bit. More...
 
int64 Cardinality () const
 Returns the number of bits set to one. More...
 
bool IsCardinalityZero () const
 Is bitset null? More...
 
bool IsCardinalityOne () const
 Does it contains only one bit set? More...
 
int64 GetFirstOne () const
 Gets the index of the first bit set starting from 0. More...
 

Detailed Description

This class represents a small reversible bitset (size <= 64).

This class is useful to maintain supports.

Definition at line 416 of file constraint_solveri.h.

Constructor & Destructor Documentation

◆ SmallRevBitSet()

operations_research::SmallRevBitSet::SmallRevBitSet ( int64  size)
explicit

Member Function Documentation

◆ Cardinality()

int64 operations_research::SmallRevBitSet::Cardinality ( ) const

Returns the number of bits set to one.

◆ GetFirstOne()

int64 operations_research::SmallRevBitSet::GetFirstOne ( ) const

Gets the index of the first bit set starting from 0.

It returns -1 if the bitset is empty.

◆ IsCardinalityOne()

bool operations_research::SmallRevBitSet::IsCardinalityOne ( ) const
inline

Does it contains only one bit set?

Definition at line 428 of file constraint_solveri.h.

◆ IsCardinalityZero()

bool operations_research::SmallRevBitSet::IsCardinalityZero ( ) const
inline

Is bitset null?

Definition at line 426 of file constraint_solveri.h.

◆ SetToOne()

void operations_research::SmallRevBitSet::SetToOne ( Solver *const  solver,
int64  pos 
)

Sets the 'pos' bit.

◆ SetToZero()

void operations_research::SmallRevBitSet::SetToZero ( Solver *const  solver,
int64  pos 
)

Erases the 'pos' bit.


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