OR-Tools  8.2
RevIntSet< T >

Detailed Description

template<class T>
class operations_research::RevIntSet< T >

This is a special class to represent a 'residual' set of T.

T must be an integer type. You fill it at first, and then during search, you can efficiently remove an element, and query the removed elements.

Definition at line 2549 of file constraint_solveri.h.

Public Types

typedef const T * const_iterator
 Iterators on the indices. More...
 

Public Member Functions

 RevIntSet (int capacity)
 Capacity is the fixed size of the set (it cannot grow). More...
 
 RevIntSet (int capacity, int *shared_positions, int shared_positions_size)
 Capacity is the fixed size of the set (it cannot grow). More...
 
 ~RevIntSet ()
 
int Size () const
 
int Capacity () const
 
Element (int i) const
 
RemovedElement (int i) const
 
void Insert (Solver *const solver, const T &elt)
 
void Remove (Solver *const solver, const T &value_index)
 
void Restore (Solver *const solver, const T &value_index)
 
void Clear (Solver *const solver)
 
const_iterator begin () const
 
const_iterator end () const
 

Static Public Attributes

static constexpr int kNoInserted = -1
 

Member Typedef Documentation

◆ const_iterator

typedef const T* const_iterator

Iterators on the indices.

Definition at line 2621 of file constraint_solveri.h.

Constructor & Destructor Documentation

◆ RevIntSet() [1/2]

RevIntSet ( int  capacity)
inlineexplicit

Capacity is the fixed size of the set (it cannot grow).

Definition at line 2554 of file constraint_solveri.h.

◆ RevIntSet() [2/2]

RevIntSet ( int  capacity,
int *  shared_positions,
int  shared_positions_size 
)
inline

Capacity is the fixed size of the set (it cannot grow).

Definition at line 2566 of file constraint_solveri.h.

◆ ~RevIntSet()

~RevIntSet ( )
inline

Definition at line 2577 of file constraint_solveri.h.

Member Function Documentation

◆ begin()

const_iterator begin ( ) const
inline

Definition at line 2622 of file constraint_solveri.h.

◆ Capacity()

int Capacity ( ) const
inline

Definition at line 2585 of file constraint_solveri.h.

◆ Clear()

void Clear ( Solver *const  solver)
inline

Definition at line 2618 of file constraint_solveri.h.

◆ Element()

T Element ( int  i) const
inline

Definition at line 2587 of file constraint_solveri.h.

◆ end()

const_iterator end ( ) const
inline

Definition at line 2623 of file constraint_solveri.h.

◆ Insert()

void Insert ( Solver *const  solver,
const T &  elt 
)
inline

Valid.

Definition at line 2599 of file constraint_solveri.h.

◆ Remove()

void Remove ( Solver *const  solver,
const T &  value_index 
)
inline

Definition at line 2608 of file constraint_solveri.h.

◆ RemovedElement()

T RemovedElement ( int  i) const
inline

Definition at line 2593 of file constraint_solveri.h.

◆ Restore()

void Restore ( Solver *const  solver,
const T &  value_index 
)
inline

Definition at line 2613 of file constraint_solveri.h.

◆ Size()

int Size ( ) const
inline

Definition at line 2583 of file constraint_solveri.h.

Member Data Documentation

◆ kNoInserted

constexpr int kNoInserted = -1
staticconstexpr

Definition at line 2551 of file constraint_solveri.h.


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