OR-Tools  8.2
RevBitMatrix

Detailed Description

Matrix version of the RevBitSet class.

Definition at line 463 of file constraint_solveri.h.

Public Member Functions

 RevBitMatrix (int64 rows, int64 columns)
 
 ~RevBitMatrix ()
 
void SetToOne (Solver *const solver, int64 row, int64 column)
 Sets the 'column' bit in the 'row' row. More...
 
void SetToZero (Solver *const solver, int64 row, int64 column)
 Erases the 'column' bit in the 'row' row. More...
 
bool IsSet (int64 row, int64 column) const
 Returns whether the 'column' bit in the 'row' row is set. More...
 
int64 Cardinality (int row) const
 Returns the number of bits set to one in the 'row' row. More...
 
bool IsCardinalityZero (int row) const
 Is bitset of row 'row' null? More...
 
bool IsCardinalityOne (int row) const
 Does the 'row' bitset contains only one bit set? More...
 
int64 GetFirstBit (int row, int start) const
 Returns the first bit in the row 'row' which position is >= 'start'. More...
 
void ClearAll (Solver *const solver)
 Cleans all bits. More...
 

Private Member Functions

void SetToOne (Solver *const solver, int64 index)
 Sets the 'index' bit. More...
 
void SetToZero (Solver *const solver, int64 index)
 Erases the 'index' bit. More...
 
bool IsSet (int64 index) const
 Returns whether the 'index' bit is set. 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 GetFirstBit (int start) const
 Gets the index of the first bit set starting from start. More...
 

Constructor & Destructor Documentation

◆ RevBitMatrix()

RevBitMatrix ( int64  rows,
int64  columns 
)

Definition at line 159 of file utilities.cc.

◆ ~RevBitMatrix()

Definition at line 165 of file utilities.cc.

Member Function Documentation

◆ Cardinality()

int64 Cardinality ( int  row) const

Returns the number of bits set to one in the 'row' row.

Definition at line 183 of file utilities.cc.

◆ ClearAll()

void ClearAll ( Solver *const  solver)

Cleans all bits.

Definition at line 215 of file utilities.cc.

◆ GetFirstBit()

int64 GetFirstBit ( int  row,
int  start 
) const

Returns the first bit in the row 'row' which position is >= 'start'.

It returns -1 if there are none.

Definition at line 200 of file utilities.cc.

◆ IsCardinalityOne()

bool IsCardinalityOne ( int  row) const

Does the 'row' bitset contains only one bit set?

Definition at line 190 of file utilities.cc.

◆ IsCardinalityZero()

bool IsCardinalityZero ( int  row) const

Is bitset of row 'row' null?

Definition at line 195 of file utilities.cc.

◆ IsSet()

bool IsSet ( int64  row,
int64  column 
) const
inline

Returns whether the 'column' bit in the 'row' row is set.

Definition at line 473 of file constraint_solveri.h.

◆ SetToOne()

void SetToOne ( Solver *const  solver,
int64  row,
int64  column 
)

Sets the 'column' bit in the 'row' row.

Definition at line 167 of file utilities.cc.

◆ SetToZero()

void SetToZero ( Solver *const  solver,
int64  row,
int64  column 
)

Erases the 'column' bit in the 'row' row.

Definition at line 175 of file utilities.cc.


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