38#pragma GCC visibility push(default)
41template <
class BaseType,
class CoType>
44 Active<BaseType, CoType> *a,
50 redundantAge_(0,max-1, 0)
52 n_ = (max < a->number()) ? max : a->number();
54 for (
int i = 0; i < n_; i++)
55 active_[i] =
new PoolSlotRef<BaseType, CoType>(*(a->active_[i]));
59template <
class BaseType,
class CoType>
60Active<BaseType, CoType>::Active(
const Active<BaseType, CoType> &rhs)
65 redundantAge_(0, rhs.max()-1, 0)
67 for (
int i = 0; i < n_; i++) {
68 active_[i] =
new PoolSlotRef<BaseType, CoType>(*(rhs.active_[i]));
69 redundantAge_[i] = rhs.redundantAge_[i];
74template <
class BaseType,
class CoType>
75Active<BaseType, CoType>::~Active()
77 for (
int i = 0; i < n_; i++)
82template <
class BaseType,
class CoType>
83std::ostream &
operator<<(std::ostream &out,
const Active<BaseType, CoType> &rhs)
85 for (
int i = 0; i < rhs.n_; i++) {
87 BaseType *cv = rhs.active_[i]->conVar();
91 out <<
"void" << std::endl;
97template <
class BaseType,
class CoType>
98void Active<BaseType, CoType>::insert(PoolSlot<BaseType, CoType> *ps)
102 active_[n_] =
new PoolSlotRef<BaseType, CoType>(ps);
103 redundantAge_[n_] = 0;
108template <
class BaseType,
class CoType>
109void Active<BaseType, CoType>::insert(
110 ArrayBuffer<PoolSlot<BaseType, CoType> *> &ps)
112 const int nPs = ps.size();
114 for(
int i = 0; i < nPs; i++)
119template <
class BaseType,
class CoType>
120void Active<BaseType, CoType>::remove(ArrayBuffer<int> &del)
122 const int nDel = del.size();
124 for(
int i = 0; i < nDel; i++)
125 delete active_[del[i]];
126 active_.leftShift(del);
127 redundantAge_.leftShift(del);
132template <
class BaseType,
class CoType>
133void Active<BaseType, CoType>::realloc(
int newSize)
135 active_.resize(newSize);
136 redundantAge_.resize(newSize);
140#pragma GCC visibility pop
Active(Master *master, int max)
Creates an empty set of active items.
constraints and variables.
#define OGDF_ASSERT(expr)
Assert condition expr. See doc/build.md for more information.
the master of the optimization.
std::ostream & operator<<(std::ostream &os, const ogdf::Array< E, INDEX > &a)
Prints array a to output stream os.