38 template<
class BaseType,
class CoType>
41 template<
class BaseType,
class CoType>
42 ostream& operator<< (ostream &out, const StandardPool<BaseType,CoType> &rhs);
56 template<
class BaseType,
class CoType>
88 friend ostream& operator<< <> (ostream &out,
const StandardPool &rhs);
101 virtual PoolSlot<BaseType,CoType> *
insert(BaseType*cv);
162 double minAbsViolation = 0.001,
192 Logger::ifout() <<
"StandardPool::putSlot(): you cannot put a non-void slot.\n";
Declaration of singly linked lists and iterators.
int size() const
Return the maximal number of constraints/variables that can be inserted in the pool.
virtual void increase(int size)
Enlarges the pool to store up to size items.
virtual void putSlot(PoolSlot< BaseType, CoType > *slot)
Inserts the slot in the list of free slots.
The parameterized class Array implements dynamic arrays of type E.
PoolSlot< BaseType, CoType > * slot(int i)
Returns a pointer to the i-th slot in the pool.
virtual ~StandardPool()
The destructor.
Array< PoolSlot< BaseType, CoType > * > pool_
The array with the pool slots.
ogdf::SListPure< PoolSlot< BaseType, CoType > * > freeSlots_
The linked lists of unused slots.
BaseType * conVar() const
Returns a pointer to the constraint/variable in the pool slot.
static std::ostream & ifout()
stream for forced output (global; used by internal libraries, e.g. Abacus)
StandardPool(Master *master, int size, bool autoRealloc=false)
Creates an empty pool.
const StandardPool & operator=(const StandardPool &rhs)
#define OGDF_THROW_PARAM(CLASS, PARAM)
Replacement for throw.
Exception thrown when an algorithm realizes an internal bug that prevents it from continuing...
int cleanup()
Cleans-up the pool.
virtual int separate(double *x, Active< CoType, BaseType > *active, Sub *sub, CutBuffer< BaseType, CoType > *cutBuffer, double minAbsViolation=0.001, int ranking=0)
Checks if a pair of a vector and an active constraint/variable set violates any item in the pool...
Stores constraints and variables.
virtual PoolSlot< BaseType, CoType > * getSlot()
Returns a free slot, or 0 if no free slot is available.
bool autoRealloc_
If the pool becomes full and this member is true, then an automatic reallocation is performed...
int removeNonActive(int maxRemove)
Tries to remove at most maxRemove inactive items from the pool.
virtual PoolSlot< BaseType, CoType > * insert(BaseType *cv)
Tries to insert a constraint/variable in the pool.