#include <nonduplpool.h>
Inheritance diagram for ABA_NONDUPLPOOL< BaseType, CoType >:

Public Member Functions | |
| ABA_NONDUPLPOOL (ABA_MASTER *master, int size, bool autoRealloc=false) | |
| virtual | ~ABA_NONDUPLPOOL () |
| The destructor. | |
| virtual ABA_POOLSLOT< BaseType, CoType > * | insert (BaseType *cv) |
| Before the function insert() tries to insert a constraint/variable in the pool, it checks if the constraint/variable is already contained in the pool. If the constraint/variable cv is contained in the pool, it is deleted. | |
| virtual ABA_POOLSLOT< BaseType, CoType > * | present (BaseType *cv) |
| virtual void | increase (int size) |
| void | statistics (int &nDuplications, int &nCollisions) const |
| Determines the number of constraints that have not been inserted into the pool, because an equivalent was already present. | |
Private Member Functions | |
| virtual int | softDeleteConVar (ABA_POOLSLOT< BaseType, CoType > *slot) |
| Has to be redefined because the slot has to be removed from the hash table if the constraint/variable can be deleted. | |
| virtual void | hardDeleteConVar (ABA_POOLSLOT< BaseType, CoType > *slot) |
| ABA_NONDUPLPOOL (const ABA_NONDUPLPOOL &rhs) | |
| const ABA_NONDUPLPOOL & | operator= (const ABA_NONDUPLPOOL &rhs) |
Private Attributes | |
| ABA_HASH< unsigned, ABA_POOLSLOT< BaseType, CoType > * > | hash_ |
| int | nDuplications_ |
| hash_ | A hash table for a fast access to the pool slot storing a constraint/variable. | |
| nDuplications_ | The number of insertions of constraints/variables that were rejected since the constraint/variable is stored already in the pool. |
Definition at line 52 of file nonduplpool.h.
| ABA_NONDUPLPOOL< BaseType, CoType >::ABA_NONDUPLPOOL | ( | ABA_MASTER * | master, | |
| int | size, | |||
| bool | autoRealloc = false | |||
| ) |
The constructor for an empty pool.
| master | A pointer to the corresponding master of the optimization. | |
| size | The maximal number of items which can be inserted in the pool without reallocation. | |
| autoRealloc | If this argument is true an automatic reallocation is performed if the pool is full. |
| virtual ABA_NONDUPLPOOL< BaseType, CoType >::~ABA_NONDUPLPOOL | ( | ) | [virtual] |
The destructor.
| ABA_NONDUPLPOOL< BaseType, CoType >::ABA_NONDUPLPOOL | ( | const ABA_NONDUPLPOOL< BaseType, CoType > & | rhs | ) | [private] |
| virtual ABA_POOLSLOT<BaseType, CoType>* ABA_NONDUPLPOOL< BaseType, CoType >::insert | ( | BaseType * | cv | ) | [virtual] |
Before the function insert() tries to insert a constraint/variable in the pool, it checks if the constraint/variable is already contained in the pool. If the constraint/variable cv is contained in the pool, it is deleted.
| cv | The constraint/variable being inserted. |
Reimplemented from ABA_STANDARDPOOL< BaseType, CoType >.
| virtual ABA_POOLSLOT<BaseType, CoType>* ABA_NONDUPLPOOL< BaseType, CoType >::present | ( | BaseType * | cv | ) | [virtual] |
Checks if a constraint/variables is already contained in the pool.
| cv | A pointer to a constraint/variable for which it should be checked if an equivalent item is already contained in the pool. |
| virtual void ABA_NONDUPLPOOL< BaseType, CoType >::increase | ( | int | size | ) | [virtual] |
Enlarges the pool to store.
To avoid fatal errors we do not allow decreasing the size of the pool. This function redefines the virtual function of the base class ABA_STANDARDPOOL because we have to reallocate the hash table.
| size | The new size of the pool. |
Reimplemented from ABA_STANDARDPOOL< BaseType, CoType >.
| void ABA_NONDUPLPOOL< BaseType, CoType >::statistics | ( | int & | nDuplications, | |
| int & | nCollisions | |||
| ) | const |
Determines the number of constraints that have not been inserted into the pool, because an equivalent was already present.
Also the number of collisions in the hash table is computed. If this number is high, it might indicate that your hash function is not chosen very well.
| nDuplications | The number of constraints that have not been inserted into the pool because an equivalent one was already present. | |
| nCollisions | The number of collisions in the hash table. |
| virtual int ABA_NONDUPLPOOL< BaseType, CoType >::softDeleteConVar | ( | ABA_POOLSLOT< BaseType, CoType > * | slot | ) | [private, virtual] |
Has to be redefined because the slot has to be removed from the hash table if the constraint/variable can be deleted.
1 otherwise.
| slot | A pointer to the pool slot from wich the constraint/variable should be deleted. |
Reimplemented from ABA_POOL< BaseType, CoType >.
| virtual void ABA_NONDUPLPOOL< BaseType, CoType >::hardDeleteConVar | ( | ABA_POOLSLOT< BaseType, CoType > * | slot | ) | [private, virtual] |
Has to be redefined because the pool slot has to be removed from the hash table.
| slot | A pointer to the pool slot from wich the constraint/variable should be deleted. |
Reimplemented from ABA_POOL< BaseType, CoType >.
| const ABA_NONDUPLPOOL& ABA_NONDUPLPOOL< BaseType, CoType >::operator= | ( | const ABA_NONDUPLPOOL< BaseType, CoType > & | rhs | ) | [private] |
ABA_HASH<unsigned, ABA_POOLSLOT<BaseType, CoType>*> ABA_NONDUPLPOOL< BaseType, CoType >::hash_ [private] |
Definition at line 142 of file nonduplpool.h.
int ABA_NONDUPLPOOL< BaseType, CoType >::nDuplications_ [private] |
Definition at line 143 of file nonduplpool.h.
1.5.1