#include <cutbuffer.h>
Inheritance diagram for ABA_CUTBUFFER< BaseType, CoType >:

Public Member Functions | |
| ABA_CUTBUFFER (ABA_MASTER *master, int size) | |
| ~ABA_CUTBUFFER () | |
| int | size () const |
| int | number () const |
| int | space () const |
| int | insert (ABA_POOLSLOT< BaseType, CoType > *slot, bool keepInPool) |
| int | insert (ABA_POOLSLOT< BaseType, CoType > *slot, bool keepInPool, double rank) |
| In addition to the previous version of the function insert() this version also adds a rank to the item such that all buffered items can be sorted with the function sort(). | |
| void | remove (ABA_BUFFER< int > &index) |
| ABA_POOLSLOT< BaseType, CoType > * | slot (int i) |
Private Member Functions | |
| void | extract (int max, ABA_BUFFER< ABA_POOLSLOT< BaseType, CoType > * > &newSlots) |
| void | sort (int threshold) |
| ABA_CUTBUFFER (const ABA_CUTBUFFER< BaseType, CoType > &rhs) | |
| const ABA_CUTBUFFER< BaseType, CoType > & | operator= (const ABA_CUTBUFFER< BaseType, CoType > &rhs) |
Private Attributes | |
| ABA_MASTER * | master_ |
| int | n_ |
| ABA_ARRAY< ABA_POOLSLOTREF< BaseType, CoType > * > | psRef_ |
| ABA_ARRAY< bool > | keepInPool_ |
| If keepInPool_[i] is true for a buffered constraint/variables, then it is not removed from its pool although it might be discarded in extract(). | |
| ABA_ARRAY< double > | rank_ |
| bool | ranking_ |
| This flag is true if a rank for each buffered item is available. As soon as an item without rank is inserted it becomes false. | |
Friends | |
| class | ABA_SUB |
Definition at line 49 of file cutbuffer.h.
| ABA_CUTBUFFER< BaseType, CoType >::ABA_CUTBUFFER | ( | ABA_MASTER * | master, | |
| int | size | |||
| ) |
The constructor.
| master | A pointer to the corresponding master of the optimization. | |
| size | The maximal number of constraints/variables which can be buffered. |
| ABA_CUTBUFFER< BaseType, CoType >::~ABA_CUTBUFFER | ( | ) |
The destructor.
If there are still items buffered when this object is destructed then we have to unset the locks of the buffered items. This can happen if in the feasibility test constraints are generated but for some reason (e.g., due to tailing off) the optimization of the subproblem is terminated.
| ABA_CUTBUFFER< BaseType, CoType >::ABA_CUTBUFFER | ( | const ABA_CUTBUFFER< BaseType, CoType > & | rhs | ) | [private] |
| int ABA_CUTBUFFER< BaseType, CoType >::size | ( | ) | const |
| int ABA_CUTBUFFER< BaseType, CoType >::number | ( | ) | const |
| int ABA_CUTBUFFER< BaseType, CoType >::space | ( | ) | const |
| int ABA_CUTBUFFER< BaseType, CoType >::insert | ( | ABA_POOLSLOT< BaseType, CoType > * | slot, | |
| bool | keepInPool | |||
| ) |
Adds a slot to the buffer.
The member ranking_ has to be set to false, because since no rank is added together with this item a ranking of all items is impossible. Such that newly generated items cannot be removed immediately in a cleaning up process of the pool we set a lock which will be removed in the function extract().
1 If the buffer is already full.
| slot | The inserted pool slot. | |
| keepInPool | If the flag keepInPool is true, then the item stored in the slot is not removed from the pool, even if it is discarded in extract(). Items regenerated from a pool should always have this flag set to true. |
| int ABA_CUTBUFFER< BaseType, CoType >::insert | ( | ABA_POOLSLOT< BaseType, CoType > * | slot, | |
| bool | keepInPool, | |||
| double | rank | |||
| ) |
In addition to the previous version of the function insert() this version also adds a rank to the item such that all buffered items can be sorted with the function sort().
1 If the buffer is already full.
| rank | A rank associated with the constraint/variable. |
| void ABA_CUTBUFFER< BaseType, CoType >::remove | ( | ABA_BUFFER< int > & | index | ) |
Removes the specified elements from the buffer.
| index | The numbers of the elements which should be removed. |
| ABA_POOLSLOT<BaseType, CoType>* ABA_CUTBUFFER< BaseType, CoType >::slot | ( | int | i | ) |
| void ABA_CUTBUFFER< BaseType, CoType >::extract | ( | int | max, | |
| ABA_BUFFER< ABA_POOLSLOT< BaseType, CoType > * > & | newSlots | |||
| ) | [private] |
Takes the first max items from the buffer and clears the buffer.
Constraints or variables stored in slots which are not extracted are also removed from their pools if keepInPool has not been set to true at insertion time.
| max | The maximal number of extracted items. | |
| newSlots | The extracted items are inserted into this buffer. |
| void ABA_CUTBUFFER< BaseType, CoType >::sort | ( | int | threshold | ) | [private] |
Sorts the items according to their ranks.
| threshold | Only if more than threshold items are buffered, the sorting is performed. |
| const ABA_CUTBUFFER<BaseType, CoType>& ABA_CUTBUFFER< BaseType, CoType >::operator= | ( | const ABA_CUTBUFFER< BaseType, CoType > & | rhs | ) | [private] |
friend class ABA_SUB [friend] |
Definition at line 50 of file cutbuffer.h.
ABA_MASTER* ABA_CUTBUFFER< BaseType, CoType >::master_ [private] |
A pointer to the corresponding master of the optimization.
Definition at line 150 of file cutbuffer.h.
int ABA_CUTBUFFER< BaseType, CoType >::n_ [private] |
The number of buffered items.
Definition at line 154 of file cutbuffer.h.
ABA_ARRAY<ABA_POOLSLOTREF<BaseType, CoType>*> ABA_CUTBUFFER< BaseType, CoType >::psRef_ [private] |
References to the pool slots of the buffered constraints/variables.
Definition at line 158 of file cutbuffer.h.
ABA_ARRAY<bool> ABA_CUTBUFFER< BaseType, CoType >::keepInPool_ [private] |
If keepInPool_[i] is true for a buffered constraint/variables, then it is not removed from its pool although it might be discarded in extract().
Definition at line 164 of file cutbuffer.h.
ABA_ARRAY<double> ABA_CUTBUFFER< BaseType, CoType >::rank_ [private] |
This array stores optionally the rank of the buffered items.
Definition at line 168 of file cutbuffer.h.
bool ABA_CUTBUFFER< BaseType, CoType >::ranking_ [private] |
This flag is true if a rank for each buffered item is available. As soon as an item without rank is inserted it becomes false.
Definition at line 173 of file cutbuffer.h.
1.5.1