57 template<
class BaseType,
class CoType>
144 void statistics(
int &nDuplications,
int &nCollisions)
const {
146 nCollisions =
hash_.nCollisions();
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.
Standard pools without constraint duplication.
The master of the optimization.
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...
PoolSlot< BaseType, CoType > * slot(int i)
Returns a pointer to the i-th slot in the pool.
virtual PoolSlot< BaseType, CoType > * present(BaseType *cv)
Checks if constraint/variables cv is already contained in the pool.
AbaHash< unsigned, PoolSlot< BaseType, CoType > * > hash_
A hash table for a fast access to the pool slot storing a constraint/variable.
virtual void hardDeleteConVar(PoolSlot< BaseType, CoType > *slot)
Has to be redefined because the pool slot has to be removed from the hash table.
int nDuplications_
The number of insertions of constraints/variables that were rejected since the constraint/variable is...
NonDuplPool(Master *master, int size, bool autoRealloc=false)
Creates an empty pool.
the master of the optimization.
static std::ostream & ifout()
stream for forced output (global; used by internal libraries, e.g. Abacus)
virtual ~NonDuplPool()
The destructor.
void statistics(int &nDuplications, int &nCollisions) const
Returns some statistic information in nDuplicates and nCollisions.
Stores constraints and variables.
virtual void increase(int size)
Enlarges the pool to store up to size items.
virtual PoolSlot< BaseType, CoType > * insert(BaseType *cv)
Insert constraint/variable cv in the pool.
const NonDuplPool & operator=(const NonDuplPool &rhs)