36 template<
class BaseType,
class CoType>
class PoolSlot;
37 template<
class BaseType,
class CoType>
class PoolSlotRef;
51 template<
class BaseType,
class CoType>
52 class CutBuffer :
public AbacusRoot {
155 void sort(
int threshold);
Array< bool > keepInPool_
If keepInPool_[i] is true for a buffered constraint/variables, then it is not removed from its pool a...
const CutBuffer< BaseType, CoType > & operator=(const CutBuffer< BaseType, CoType > &rhs)
The parameterized class Array implements dynamic arrays of type E.
The master of the optimization.
Array< double > rank_
This array stores optionally the rank of the buffered items.
CutBuffer(Master *master, int size)
Creates a cut buffer with capacity size.
Master * master_
A pointer to the corresponding master of the optimization.
PoolSlot< BaseType, CoType > * slot(int i)
Returns a pointer to the i-th PoolSlot that is buffered.
An array that keeps track of the number of inserted elements; also usable as an efficient stack...
the master of the optimization.
void sort(int threshold)
Sorts the items according to their ranks.
int number() const
Returns the number of buffered items.
int n_
The number of buffered items.
int size() const
Returns the maximal number of items that can be buffered.
~CutBuffer()
The destructor.
Array< PoolSlotRef< BaseType, CoType > * > psRef_
References to the pool slots of the buffered constraints/variables.
Stores constraints and variables.
int insert(PoolSlot< BaseType, CoType > *slot, bool keepInPool)
Adds a slot to the buffer.
bool ranking_
This flag is true if a rank for each buffered item is available.
int space() const
Returns the number of items which can still be inserted into the buffer.
void extract(int max, ArrayBuffer< PoolSlot< BaseType, CoType > *> &newSlots)
Takes the first max items from the buffer and clears the buffer.