36 template<
class BaseType,
class CoType>
41 PoolSlot<BaseType, CoType>* slot;
44 if (slot ==
nullptr) {
47 hash_.insert(cv->hashKey(), slot);
57 template<
class BaseType,
class CoType>
61 int key = cv->hashKey();
63 PoolSlot<BaseType, CoType> **cand = hash_.initializeIteration(key);
65 if (cv->equal((*cand)->conVar())) {
68 cand = hash_.next(key);
73 template<
class BaseType,
class CoType>
75 const BaseType *cv)
const 77 int key = cv->hashKey();
79 PoolSlot<BaseType, CoType> *
const *cand = hash_.initializeIteration(key);
81 if (cv->equal((*cand)->conVar())) {
84 cand = hash_.next(key);
89 template<
class BaseType,
class CoType>
92 int key = slot->conVar()->hashKey();
95 if (hash_.remove(key, slot)) {
98 Logger::ifout() <<
"NonDuplPool::softDeleteCon(): slot not found in hash table.\n";
108 template<
class BaseType,
class CoType>
110 PoolSlot<BaseType, CoType> *slot)
112 if (hash_.remove(slot->conVar()->hashKey(), slot)) {
115 Logger::ifout() <<
"NonDuplPool::hardDeleteConVar(): constraint not found in hash table.\n";
virtual int softDeleteConVar(PoolSlot< BaseType, CoType > *slot)
Has to be redefined because the slot has to be removed from the hash table if the constraint/variable...
virtual PoolSlot< BaseType, CoType > * present(BaseType *cv)
Checks if constraint/variables cv is already contained in the pool.
virtual void hardDeleteConVar(PoolSlot< BaseType, CoType > *slot)
Has to be redefined because the pool slot has to be removed from the hash table.
virtual int softDeleteConVar(PoolSlot< BaseType, CoType > *slot)
Removes the constraint/variable stored in slot from the pool if it can be deleted.
static std::ostream & ifout()
stream for forced output (global; used by internal libraries, e.g. Abacus)
#define OGDF_THROW_PARAM(CLASS, PARAM)
Replacement for throw.
standard pool without constraint duplication.
virtual PoolSlot< BaseType, CoType > * insert(BaseType *cv)
Insert constraint/variable cv in the pool.
virtual PoolSlot< BaseType, CoType > * insert(BaseType *cv)
Tries to insert a constraint/variable in the pool.
virtual void hardDeleteConVar(PoolSlot< BaseType, CoType > *slot)
Removes a constraint/variable from the pool and adds the slot to the set of free slots.