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

Matrix version of the RevBitSet class. More...

#include <constraint_solveri.h>

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

Public Member Functions

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

Detailed Description

Matrix version of the RevBitSet class.

Definition at line 468 of file constraint_solveri.h.

Constructor & Destructor Documentation

◆ RevBitMatrix()

operations_research::RevBitMatrix::RevBitMatrix ( int64_t rows,
int64_t columns )

--— RevBitMatrix --—

Definition at line 163 of file utilities.cc.

◆ ~RevBitMatrix()

operations_research::RevBitMatrix::~RevBitMatrix ( )

Definition at line 169 of file utilities.cc.

Member Function Documentation

◆ Cardinality()

int64_t operations_research::RevBitMatrix::Cardinality ( int row) const

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

Definition at line 188 of file utilities.cc.

◆ ClearAll()

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

Cleans all bits.

Definition at line 221 of file utilities.cc.

◆ GetFirstBit()

int64_t operations_research::RevBitMatrix::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 205 of file utilities.cc.

◆ IsCardinalityOne()

bool operations_research::RevBitMatrix::IsCardinalityOne ( int row) const

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

Todo
(user) : Optimize this one.

Definition at line 195 of file utilities.cc.

◆ IsCardinalityZero()

bool operations_research::RevBitMatrix::IsCardinalityZero ( int row) const

Is bitset of row 'row' null?

Definition at line 200 of file utilities.cc.

◆ IsSet()

bool operations_research::RevBitMatrix::IsSet ( int64_t row,
int64_t column ) const
inline

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

Definition at line 478 of file constraint_solveri.h.

◆ SetToOne()

void operations_research::RevBitMatrix::SetToOne ( Solver * solver,
int64_t row,
int64_t column )

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

Definition at line 171 of file utilities.cc.

◆ SetToZero()

void operations_research::RevBitMatrix::SetToZero ( Solver * solver,
int64_t row,
int64_t column )

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

Definition at line 179 of file utilities.cc.


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