46template<
class BaseType,
class CoType>
class Active;
105 :
ConVar(rhs), sense_(rhs.sense_), rhs_(rhs.rhs_), conClass_(
nullptr), liftable_(rhs.liftable_)
130 virtual double rhs()
const {
return rhs_; }
153 virtual bool valid(
Sub *sub)
const;
296 :
ConVar(master, sub, dynamic, local), sense_(sense), rhs_(rhs), conClass_(
nullptr), liftable_(liftable)
299 Logger::ifout() <<
"Constraint::Constraint(): subtree of local item must not be 0\n";
Implements the sets of active constraints and variables which are associated with each subproblem.
Constraint classification.
Common base class for constraints (Constraint) and variables (Variable).
const Sub * sub_
A pointer to the subproblem associated with the constraint/variable.
const Sub * sub() const
Returns a const pointer to the subproblem associated with the constraint/variable.
bool local() const
Returns true if the constraint/variable is only locally valid, false otherwise.
bool local_
true if the constraint/variable is only locally valid
Forms the virtual base class for all possible constraints given in pool format.
bool liftable() const
Checks if the constraint is liftable.
CSense sense_
The sense of the constraint.
void printRow(std::ostream &out, Active< Variable, Constraint > *var) const
Writes the row format of the constraint associated with the variable set var to output stream out.
virtual double slack(Active< Variable, Constraint > *variables, double *x) const
Computes the slack of the vector x associated with the variable set variables.
bool liftable_
This member is true if also coefficients of variables which have been inactive at generation time can...
CSense * sense()
Returns a pointer to the sense of the constraint.
virtual bool violated(Active< Variable, Constraint > *variables, double *x, double *sl=nullptr) const
Checks if a constraint is violated by a vector x associated with a variable set.
Constraint(const Constraint &rhs)
Copy constructor.
Constraint(Master *master, const Sub *sub, CSense::SENSE sense, double rhs, bool dynamic, bool local, bool liftable)
Initializes a constraint.
virtual InfeasCon::INFEAS voidLhsViolated(double newRhs) const
Can be called if after variable elimination the left hand side of the constraint has become void and ...
virtual int genRow(Active< Variable, Constraint > *var, Row &row) const
Generates the row format of the constraint associated with the variable set var.
virtual double coeff(const Variable *v) const =0
Returns the coefficient of the variable v in the constraint.
const Constraint & operator=(const Constraint &rhs)
const CSense * sense() const
Returns a const pointer to the sense of the constraint.
ConClass * classification(Active< Variable, Constraint > *var=nullptr) const
Returns a pointer to the classification of the constraint.
virtual double distance(double *x, Active< Variable, Constraint > *actVar) const
Returns the Euclidean distance of x associated with variable set actVar to the hyperplane induced by ...
virtual bool valid(Sub *sub) const
Checks if the constraint is valid for the subproblem sub.
double rhs_
The right hand side of the constraint.
virtual ConClass * classify(Active< Variable, Constraint > *var) const
The default implementation returns a 0 pointer.
virtual bool violated(double slack) const
Checks if a constraint is violated given the slack of a vector.
virtual double rhs() const
Returns the right hand side of the constraint.
INFEAS
The different ways of infeasibility of a constraint.
The linear program of a subproblem.
The master of the optimization.
Representation of constraints in the row format.
bool ancestor(const Sub *sub) const
Returns true if this subproblem is an ancestor of the subproblem sub, false otherwise.
Forms the virtual base class for all possible variables given in pool format.
Exception thrown when an algorithm realizes an internal bug that prevents it from continuing.
static std::ostream & ifout()
stream for forced output (global; used by internal libraries, e.g. Abacus)
constraint classification.
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
constraints and variables.
#define OGDF_ASSERT(expr)
Assert condition expr. See doc/build.md for more information.
#define OGDF_THROW_PARAM(CLASS, PARAM)
Replacement for throw.
the master of the optimization.
static MultilevelBuilder * getDoubleFactoredZeroAdjustedMerger()