42 template<
class BaseType,
class CoType>
class PoolSlot;
43 template<
class BaseType,
class CoType>
class PoolSlotRef;
45 template<
class BaseType,
class CoType>
class CutBuffer;
109 bool active()
const {
return (nActive_ != 0); }
113 bool local()
const {
return local_; }
124 virtual bool dynamic()
const {
return dynamic_; }
175 return !(nReferences_ || nLocks_);
193 virtual void print(std::ostream &out)
const;
228 virtual unsigned hashKey()
const;
250 virtual const char *name()
const;
271 virtual bool equal(
const ConVar *cv)
const;
279 virtual double rank()
const {
return 0; }
321 void _expand()
const;
329 void _compress()
const;
365 void removeReference();
379 bool locked()
const {
return (nLocks_ != 0); }
397 Logger::ifout() <<
"ConVar::~ConVar(): constraint/variable still active: \ncounter = " << nActive_ <<
"\n";
401 Logger::ifout() <<
"ConVar::~ConVar(): constraint/variable has still " << nLocks_ <<
" locks\n";
404 #ifndef OGDF_USE_ASSERT_EXCEPTIONS // do not throw exceptions in destructor 421 if(--nReferences_ < 0) {
422 Logger::ifout() <<
"ConVar::removeReference : reference counter negative\n";
virtual double rank() const
The function should return a rank associated with the constraint/variable.
void unlock()
Removes one lock from the constraint/variable.
int nActive_
The number of active subproblems of which the constraint/variable belongs to the set of active constr...
bool dynamic_
If this member is true then the constraint/variable can be also removed from the active formulation a...
virtual void compress() const
Compresses a constraint/variable.
ConVar(Master *master, const Sub *sub, bool dynamic, bool local)
Creates an instance of type ConVar.
Base class of all other classes of ABACUS.
The master of the optimization.
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Common base class for constraints (Constraint) and variables (Variable).
Master * master_
A pointer to the corresponding master of the optimization.
bool local_
true if the constraint/variable is only locally valid
void addReference()
Indicates that there is a new reference to the pool slot storing this constraint/variable.
const Sub * sub_
A pointer to the subproblem associated with the constraint/variable.
bool global() const
Returns true if the constraint/variable is globally valid, false otherwise.
bool expanded_
true, if expanded version of constraint/variables available.
Forms the virtual base class for all possible constraints given in pool format.
int nReferences_
The number of references to the pool slot the constraint is stored in.
int nLocks_
The number of locks which have been set on the constraint/variable.
static std::ostream & ifout()
stream for forced output (global; used by internal libraries, e.g. Abacus)
void lock()
Adds an additional lock to the constraint/variable.
#define OGDF_THROW_PARAM(CLASS, PARAM)
Replacement for throw.
Exception thrown when an algorithm realizes an internal bug that prevents it from continuing...
bool locked() const
Returns true if at least one lock is set on the constraint/variable, false otherwise.
virtual void expand() const
Expands a constraint/variable.
bool local() const
Returns true if the constraint/variable is only locally valid, false otherwise.
bool expanded() const
Returns true if the expanded format of a constraint/variable is available, false otherwise.
virtual bool dynamic() const
Return true if the constraint/variable is dynamic.
Forms the virtual base class for all possible variables given in pool format.
Stores a pointer to a pool slot with version number.
Stores constraints and variables.
int nReferences() const
Returns the number of references to the pool slot PoolSlotRef storing this constraint/variable.
bool active() const
Checks if the constraint/variable is active in at least one active subproblem.
void removeReference()
Is the counterpart of the function addReference() and indicates the removal of a reference to this co...
void sub(Sub *sub)
Associates a new subproblem with the constraint/variable.
void activate()
Must be called if the constraint/variable is added to the active formulation of an active subproblem...
virtual bool deletable() const
Returns true if the constraint/variable can be destructed.
void print(std::ostream &os, const Array< E, INDEX > &a, char delim=' ')
Prints array a to output stream os using delimiter delim.
const Sub * sub() const
Returns a const pointer to the subproblem associated with the constraint/variable.
#define OGDF_ASSERT(expr)
Assert condition expr. See doc/build.md for more information.
void deactivate()
Counterpart of activate().