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