Implements the sets of active constraints and variables which are associated with each subproblem. More...
#include <ogdf/lib/abacus/active.h>
Public Member Functions | |
Active (const Active< BaseType, CoType > &rhs) | |
Copy constructor. More... | |
Active (Master *master, Active *a, int max) | |
Creates a set of active items, initialized to at most max items from a. More... | |
Active (Master *master, int max) | |
Creates an empty set of active items. More... | |
~Active () | |
void | incrementRedundantAge (int i) |
Increments the number ofiterations the item i is already redundant by 1. More... | |
void | insert (ArrayBuffer< PoolSlot< BaseType, CoType > * > &ps) |
Adds constraints/variables to the active items set. More... | |
void | insert (PoolSlot< BaseType, CoType > *ps) |
Adds a constraint/variable to the active items set. More... | |
int | max () const |
Returns the maximum number of storable active items (without reallocation). More... | |
int | number () const |
Returns the current number of active items. More... | |
BaseType * | operator[] (int i) |
Access to the i-th active item. More... | |
const BaseType * | operator[] (int i) const |
Access to the i-th active item. More... | |
PoolSlotRef< BaseType, CoType > * | poolSlotRef (int i) |
Returns the i-th entry in the Array active. More... | |
const PoolSlotRef< BaseType, CoType > * | poolSlotRef (int i) const |
Returns the i-th entry in the Array active. More... | |
void | realloc (int newSize) |
Changes the maximum number of active items which can be stored. More... | |
int | redundantAge (int i) const |
Returns the number of iterations a constraint/variable is already redundant. More... | |
void | remove (ArrayBuffer< int > &del) |
Removes items from the list of active items. More... | |
void | resetRedundantAge (int i) |
Sets the number of iterations item i is redundant to 0. More... | |
Private Member Functions | |
const Active< BaseType, CoType > & | operator= (const Active< BaseType, CoType > &rhs) |
Private Attributes | |
Array< PoolSlotRef< BaseType, CoType > * > | active_ |
The array storing references to the pool slots of the active items. More... | |
Master * | master_ |
A pointer to corresponding master of the optimization. More... | |
int | n_ |
The number of active items. More... | |
Array< int > | redundantAge_ |
The number of iterations a constraint is already redundant. More... | |
Friends | |
std::ostream & | operator<< (std::ostream &out, const Active< BaseType, CoType > &rhs) |
Output operator for active sets. More... | |
Implements the sets of active constraints and variables which are associated with each subproblem.
This parameterized class implements the sets of active constraints and variables which are associated with each subproblem. Note, also an inactive subproblem can have an active set of constraints and variables, e.g., the sets with which its unprocessed sons in the enumeration tree are initialized.
If an active set of constraints is instantiated then the BaseType should be Constraint and the CoType should be Variable, for an active set of variables this is vice versa.
|
inline |
abacus::Active< BaseType, CoType >::Active | ( | Master * | master, |
Active< BaseType, CoType > * | a, | ||
int | max | ||
) |
Creates a set of active items, initialized to at most max items from a.
master | A pointer to the corresponding master of the optimization. |
a | At most max active constraints/variables are taken from this set. |
max | The maximal number of active constraints/variables. |
abacus::Active< BaseType, CoType >::Active | ( | const Active< BaseType, CoType > & | rhs | ) |
Copy constructor.
rhs | The active set that is copied. |
abacus::Active< BaseType, CoType >::~Active | ( | ) |
|
inline |
void abacus::Active< BaseType, CoType >::insert | ( | ArrayBuffer< PoolSlot< BaseType, CoType > * > & | ps | ) |
Adds constraints/variables to the active items set.
ps | The buffer storing the pool slots of all constraints/variables that are added. |
void abacus::Active< BaseType, CoType >::insert | ( | PoolSlot< BaseType, CoType > * | ps | ) |
Adds a constraint/variable to the active items set.
ps | The pool slot storing the constraint/variable being added. |
|
inline |
|
inline |
|
private |
|
inline |
|
inline |
|
inline |
|
inline |
void abacus::Active< BaseType, CoType >::realloc | ( | int | newSize | ) |
Changes the maximum number of active items which can be stored.
newSize | The new maximal number of active items. |
|
inline |
void abacus::Active< BaseType, CoType >::remove | ( | ArrayBuffer< int > & | del | ) |
Removes items from the list of active items.
del | The numbers of the items that should be removed. These numbers must be upward sorted. |
|
inline |
|
friend |
Output operator for active sets.
The output operator writes all active constraints and variables to an output stream.
If an associated pool slot is void, or the item is newer than the one we refer to, then "void"
is written.
out | The output stream. |
rhs | The active set being output. |
|
private |
|
private |
|
private |
|
private |