|
| NonDuplPool (Master *master, int size, bool autoRealloc=false) |
| Creates an empty pool.
|
|
virtual | ~NonDuplPool () |
| The destructor.
|
|
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.
|
|
virtual PoolSlot< BaseType, CoType > * | present (BaseType *cv) |
| Checks if constraint/variables cv is already contained in the pool.
|
|
virtual const PoolSlot< BaseType, CoType > * | present (const BaseType *cv) const |
| Checks if constraint/variables cv is already contained in the pool.
|
|
void | statistics (int &nDuplications, int &nCollisions) const |
| Returns some statistic information in nDuplicates and nCollisions.
|
|
Public Member Functions inherited from abacus::StandardPool< BaseType, CoType > |
| StandardPool (Master *master, int size, bool autoRealloc=false) |
| Creates an empty pool.
|
|
virtual | ~StandardPool () |
| The destructor.
|
|
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.
|
|
int | size () const |
| Return the maximal number of constraints/variables that can be inserted in the pool.
|
|
PoolSlot< BaseType, CoType > * | slot (int i) |
| Returns a pointer to the i-th slot in the pool.
|
|
| Pool (Master *master) |
| Initializes an empty pool.
|
|
virtual | ~Pool () |
|
int | number () const |
| Returns the current number of items in the pool.
|
|
void | removeConVar (PoolSlot< BaseType, CoType > *slot) |
| Removes the constraint/variable stored in a pool slot and adds the slot to the list of free slots.
|
|
virtual | ~AbacusRoot () |
| The destructor.
|
|
|
enum | RANKING { NO_RANK
, RANK
, ABS_RANK
} |
| Determines how th rank of a constraint/variable is computed. More...
|
|
static bool | ascii2bool (const string &str) |
| Converts the string str to a boolean value.
|
|
static bool | endsWith (const string &str, const string &end) |
| Returns true if str ends with end, false otherwise.
|
|
static double | fracPart (double x) |
| Returns the absolute value of the fractional part of x.
|
|
static const char * | onOff (bool value) |
| Converts a boolean variable to the strings "on" and "off".
|
|
Protected Member Functions inherited from abacus::StandardPool< BaseType, CoType > |
virtual PoolSlot< BaseType, CoType > * | getSlot () |
| Returns a free slot, or 0 if no free slot is available.
|
|
virtual void | putSlot (PoolSlot< BaseType, CoType > *slot) |
| Inserts the slot in the list of free slots.
|
|
int | removeNonActive (int maxRemove) |
| Tries to remove at most maxRemove inactive items from the pool.
|
|
Protected Attributes inherited from abacus::StandardPool< BaseType, CoType > |
bool | autoRealloc_ |
| If the pool becomes full and this member is true, then an automatic reallocation is performed.
|
|
ogdf::SListPure< PoolSlot< BaseType, CoType > * > | freeSlots_ |
| The linked lists of unused slots.
|
|
Array< PoolSlot< BaseType, CoType > * > | pool_ |
| The array with the pool slots.
|
|
Master * | master_ |
| A pointer to the corresponding master of the optimization.
|
|
int | number_ |
| The current number of constraints in the pool.
|
|
Standard pools without constraint duplication.
The class NonDuplPool provides an StandardPool with the additional feature that the same constraint is at most stored once in the pool. For constraints and variables inserted in this pool the virtual member functions name(), hashKey(), and equal() of the base class ConVar have to be defined. Using these three functions, we check at insertation time if a constraint or variable is already stored in the pool.
The implementation is unsafe in the sense that the data structure for registering a constraint is corrupted if a constraint is removed directly from the pool slot without using a function of this class.
Definition at line 58 of file nonduplpool.h.
Returns some statistic information in nDuplicates and nCollisions.
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.
- Parameters
-
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. |
Definition at line 144 of file nonduplpool.h.