Generated on: Thu Mar 29 07:46:58 PDT 2012 for custom file set
// doxy/ or-tools/ src/ constraint_solver/

operations_research::RevBitSet Class Reference

This class represents a reversible bitset. More...

#include <constraint_solveri.h>

Inheritance diagram for operations_research::RevBitSet:

operations_research::RevBitMatrix

List of all members.

Public Member Functions

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


Constructor & Destructor Documentation

operations_research::RevBitSet::RevBitSet ( int64  size  )  [explicit]

RevBitSet.

Definition at line 61 of file utilities.cc.

operations_research::RevBitSet::~RevBitSet (  ) 

Definition at line 71 of file utilities.cc.


Member Function Documentation

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

Sets the 'pos' bit.

Definition at line 84 of file utilities.cc.

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

Erases the 'pos' bit.

Definition at line 95 of file utilities.cc.

bool operations_research::RevBitSet::IsSet ( int64  pos  )  const

Returns whether the 'pos' bit is set.

Definition at line 106 of file utilities.cc.

int64 operations_research::RevBitSet::Cardinality (  )  const

Returns the number of bits set to one.

Definition at line 112 of file utilities.cc.

bool operations_research::RevBitSet::IsCardinalityZero (  )  const

Is bitset null?

Definition at line 120 of file utilities.cc.

bool operations_research::RevBitSet::IsCardinalityOne (  )  const

Does it contains only one bit set?

Definition at line 129 of file utilities.cc.

int64 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 147 of file utilities.cc.

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

Cleans all bits.

Reimplemented in operations_research::RevBitMatrix.

Definition at line 151 of file utilities.cc.


Friends And Related Function Documentation

friend class RevBitMatrix [friend]

Definition at line 469 of file constraint_solveri.h.


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