#include <standardpool.h>
Inheritance diagram for ABA_STANDARDPOOL< BaseType, CoType >:

Public Member Functions | |
| ABA_STANDARDPOOL (ABA_MASTER *master, int size, bool autoRealloc=false) | |
| virtual | ~ABA_STANDARDPOOL () |
| The destructor deletes all slots. The destructor of a pool slot deletes then also the respective constraint or variable. | |
| virtual ABA_POOLSLOT< BaseType, CoType > * | insert (BaseType *cv) |
| virtual void | increase (int size) |
| int | cleanup () |
| Scans the pool, removes all deletable items, i.e., those items without having references, and adds the corresponding slots to the list of free slots. | |
| int | size () const |
| ABA_POOLSLOT< BaseType, CoType > * | slot (int i) |
| virtual int | separate (double *x, ABA_ACTIVE< CoType, BaseType > *active, ABA_SUB *sub, ABA_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. If the pool is a constraint pool, then the vector is an LP-solution and the active set the set of active variables. Otherwise, if the pool is a variable pool, then the vector stores the values of the dual variables and the active set the associated active constraints. | |
Protected Member Functions | |
| int | removeNonActive (int maxRemove) |
| virtual ABA_POOLSLOT< BaseType, CoType > * | getSlot () |
| Returns a free slot, or 0 if no free slot is available. A returned slot is removed from the list of free slots. | |
| virtual void | putSlot (ABA_POOLSLOT< BaseType, CoType > *slot) |
Protected Attributes | |
| ABA_ARRAY< ABA_POOLSLOT< BaseType, CoType > * > | pool_ |
| ABA_LIST< ABA_POOLSLOT< BaseType, CoType > * > | freeSlots_ |
| bool | autoRealloc_ |
Private Member Functions | |
| ABA_STANDARDPOOL (const ABA_STANDARDPOOL &rhs) | |
| const ABA_STANDARDPOOL & | operator= (const ABA_STANDARDPOOL &rhs) |
Friends | |
| ostream & | operator<< (ostream &out, const ABA_STANDARDPOOL &rhs) |
| The output operator calls the output operator of each item of a non-void pool slot. | |
Definition at line 58 of file standardpool.h.
| ABA_STANDARDPOOL< BaseType, CoType >::ABA_STANDARDPOOL | ( | ABA_MASTER * | master, | |
| int | size, | |||
| bool | autoRealloc = false | |||
| ) |
The constructor for an empty pool.
All slots are inserted in the linked list of free slots.
| 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_STANDARDPOOL< BaseType, CoType >::~ABA_STANDARDPOOL | ( | ) |
The destructor deletes all slots. The destructor of a pool slot deletes then also the respective constraint or variable.
| ABA_STANDARDPOOL< BaseType, CoType >::ABA_STANDARDPOOL | ( | const ABA_STANDARDPOOL< BaseType, CoType > & | rhs | ) | [private] |
| virtual ABA_POOLSLOT<BaseType,CoType>* ABA_STANDARDPOOL< BaseType, CoType >::insert | ( | BaseType * | cv | ) | [virtual] |
Tries to insert a constraint/variable in the pool.
If there is no free slot available, we try to generate free slots by removing redundant items, i.e., items which have no reference to them. If this fails, we either perform an automatic reallocation of the pool or remove non-active items.
| cv | The constraint/variable being inserted. |
Implements ABA_POOL< BaseType, CoType >.
Reimplemented in ABA_NONDUPLPOOL< BaseType, CoType >.
| virtual void ABA_STANDARDPOOL< 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.
| size | The new size of the pool. |
Reimplemented in ABA_NONDUPLPOOL< BaseType, CoType >.
| int ABA_STANDARDPOOL< BaseType, CoType >::cleanup | ( | ) |
Scans the pool, removes all deletable items, i.e., those items without having references, and adds the corresponding slots to the list of free slots.
| int ABA_STANDARDPOOL< BaseType, CoType >::size | ( | ) | const |
| ABA_POOLSLOT<BaseType,CoType>* ABA_STANDARDPOOL< BaseType, CoType >::slot | ( | int | i | ) |
| i | The number of the slot being accessed. |
| virtual int ABA_STANDARDPOOL< BaseType, CoType >::separate | ( | double * | x, | |
| ABA_ACTIVE< CoType, BaseType > * | active, | |||
| ABA_SUB * | sub, | |||
| ABA_CUTBUFFER< BaseType, CoType > * | cutBuffer, | |||
| double | minAbsViolation = 0.001, |
|||
| int | ranking = 0 | |||
| ) | [virtual] |
Checks if a pair of a vector and an active constraint/variable set violates any item in the pool. If the pool is a constraint pool, then the vector is an LP-solution and the active set the set of active variables. Otherwise, if the pool is a variable pool, then the vector stores the values of the dual variables and the active set the associated active constraints.
| z | The vector for which violation is checked. | |
| active | The constraint/variable set associated with z. | |
| sub | The subproblem for which validity of the violated item is required. | |
| cutBuffer | The violated constraints/variables are added to this buffer. | |
| minAbsViolation | A violated constraint/variable is only added to the cutBuffer if the absolute value of its violation is at least minAbsViolation. The default value is 0.001. | |
| ranking | If 1, the violation is associated with a rank of item in the buffer, if 2 the absolute violation is used, if 3 the function ABA_CONVAR::rank() is used, if 0 no rank is associated with the item. |
Implements ABA_POOL< BaseType, CoType >.
| int ABA_STANDARDPOOL< BaseType, CoType >::removeNonActive | ( | int | maxRemove | ) | [protected] |
Tries to remove at most maxRemove inactive items from the pool.
A minimum heap of the items with the reference counter as key is built up and items are removed in this order.
| virtual ABA_POOLSLOT<BaseType,CoType>* ABA_STANDARDPOOL< BaseType, CoType >::getSlot | ( | ) | [protected, virtual] |
Returns a free slot, or 0 if no free slot is available. A returned slot is removed from the list of free slots.
This function defines the pure virtual function of the base class ABA_POOL.
Implements ABA_POOL< BaseType, CoType >.
| virtual void ABA_STANDARDPOOL< BaseType, CoType >::putSlot | ( | ABA_POOLSLOT< BaseType, CoType > * | slot | ) | [protected, virtual] |
Inserts the slot in the list of free slots.
It is an error to insert a slot which is not empty.
This function defines the pure virtual function of the base class ABA_POOL.
Implements ABA_POOL< BaseType, CoType >.
| const ABA_STANDARDPOOL& ABA_STANDARDPOOL< BaseType, CoType >::operator= | ( | const ABA_STANDARDPOOL< BaseType, CoType > & | rhs | ) | [private] |
| ostream& operator<< | ( | ostream & | out, | |
| const ABA_STANDARDPOOL< BaseType, CoType > & | rhs | |||
| ) | [friend] |
The output operator calls the output operator of each item of a non-void pool slot.
| out | The output stream. | |
| rhs | The pool being output. |
ABA_ARRAY<ABA_POOLSLOT<BaseType,CoType> *> ABA_STANDARDPOOL< BaseType, CoType >::pool_ [protected] |
The array with the pool slots.
Definition at line 235 of file standardpool.h.
ABA_LIST<ABA_POOLSLOT<BaseType,CoType> *> ABA_STANDARDPOOL< BaseType, CoType >::freeSlots_ [protected] |
The linked lists of unused slots.
Definition at line 239 of file standardpool.h.
bool ABA_STANDARDPOOL< BaseType, CoType >::autoRealloc_ [protected] |
If the pool becomes full and this member is true, then an automatic reallocation is performed.
Definition at line 245 of file standardpool.h.
1.5.1