6.42 ABA_CUTBUFFER< BaseType, CoType > Class Template Reference

template class implements a buffer for constraints and variables which are generated during the cutting plane or column generation phase.

#include <cutbuffer.h>

Inheritance diagram for ABA_CUTBUFFER< BaseType, CoType >::


PIC


Public Member Functions

Private Member Functions

Private Attributes

Friends

6.42.1 Detailed Description

template<class BaseType, class CoType> class ABA_CUTBUFFER< BaseType, CoType >

template class implements a buffer for constraints and variables which are generated during the cutting plane or column generation phase.

Definition at line 49 of file cutbuffer.h.

6.42.2 Constructor & Destructor Documentation

6.42.2.1 template<class BaseType, class CoType> ABA_CUTBUFFER< BaseType, CoType >::ABA_CUTBUFFER (ABA_MASTER * master, int size)

The constructor.

Parameters:

master
A pointer to the corresponding master of the optimization.
size
The maximal number of constraints/variables which can be buffered.

6.42.2.2 template<class BaseType, class CoType> 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.

6.42.2.3 template<class BaseType, class CoType> ABA_CUTBUFFER< BaseType, CoType >::ABA_CUTBUFFER (const ABA_CUTBUFFER< BaseType, CoType > & rhs) [private]

6.42.3 Member Function Documentation

6.42.3.1 template<class BaseType, class CoType> int ABA_CUTBUFFER< BaseType, CoType >::size () const

Returns:

The maximal number of items that can be buffered.

6.42.3.2 template<class BaseType, class CoType> int ABA_CUTBUFFER< BaseType, CoType >::number () const

Returns:

The number of buffered items.

6.42.3.3 template<class BaseType, class CoType> int ABA_CUTBUFFER< BaseType, CoType >::space () const

Returns:

The number of items which can still be inserted into the buffer.

6.42.3.4 template<class BaseType, class CoType> 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().

Returns:

0 If the item can be inserted.

1 If the buffer is already full.

Parameters:

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.

6.42.3.5 template<class BaseType, class CoType> 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().

Returns:

0 If the item can be inserted.

1 If the buffer is already full.

Parameters:

rank
A rank associated with the constraint/variable.

6.42.3.6 template<class BaseType, class CoType> void ABA_CUTBUFFER< BaseType, CoType >::remove (ABA_BUFFER< int > & index)

Removes the specified elements from the buffer.

Parameters:

index
The numbers of the elements which should be removed.

6.42.3.7 template<class BaseType, class CoType> ABA_POOLSLOT<BaseType, CoType>*ABA_CUTBUFFER< BaseType, CoType >::slot (int i)

Returns:

A pointer to the i-th ABA_POOLSLOT that is buffered.

6.42.3.8 template<class BaseType, class CoType> 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.

Parameters:

max
The maximal number of extracted items.
newSlots
The extracted items are inserted into this buffer.

6.42.3.9 template<class BaseType, class CoType> void ABA_CUTBUFFER< BaseType, CoType >::sort (int threshold) [private]

Sorts the items according to their ranks.

Parameters:

threshold
Only if more than threshold items are buffered, the sorting is performed.

6.42.3.10 template<class BaseType, class CoType> const ABA_CUTBUFFER<BaseType, CoType>& ABA_CUTBUFFER< BaseType, CoType >::operator= (const ABA_CUTBUFFER< BaseType, CoType > & rhs) [private]

6.42.4 Friends And Related Function Documentation

6.42.4.1 template<class BaseType, class CoType> friend class ABA_SUB [friend]

Definition at line 50 of file cutbuffer.h.

6.42.5 Member Data Documentation

6.42.5.1 template<class BaseType, class CoType> 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.

6.42.5.2 template<class BaseType, class CoType> int ABA_CUTBUFFER< BaseType, CoType >::n_ [private]

The number of buffered items.

Definition at line 154 of file cutbuffer.h.

6.42.5.3 template<class BaseType, class CoType> 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.

6.42.5.4 template<class BaseType, class CoType> 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.

6.42.5.5 template<class BaseType, class CoType> 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.

6.42.5.6 template<class BaseType, class CoType> 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.

The documentation for this class was generated from the following file: