Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
numcon.h
Go to the documentation of this file.
1
33#pragma once
34
36
37
38namespace abacus {
39
40
42
47public:
48
50
67 NumCon(Master *master,
68 const Sub *sub,
69 CSense::SENSE sense,
70 bool dynamic,
71 bool local,
72 bool liftable,
73 int number,
74 double rhs)
75 : Constraint(master, sub, sense, rhs, dynamic, local, liftable), number_(number)
76 { }
77
79 virtual ~NumCon() { }
80
82
88 friend std::ostream &operator<<(std::ostream &out, const NumCon &rhs) {
89 return out << "number = " << rhs.number_ << " rhs = " << rhs.rhs_ << std::endl;
90 }
91
93
97 virtual double coeff(const Variable *v) const;
98
100
105 virtual void print(std::ostream &out) const {
106 out << *this;
107 }
108
110 int number() const { return number_; }
111
112
113private:
115};
116
117}
118
120
121namespace abacus {
122
123inline double NumCon::coeff(const Variable *v) const
124{
125 const ColVar *colvar = (const ColVar *) v;
126 return colvar->coeff(number_);
127}
128
129}
Some optimization problems, in particular column generation problems, are better described from a var...
Definition colvar.h:56
Forms the virtual base class for all possible constraints given in pool format.
Definition constraint.h:56
double rhs_
The right hand side of the constraint.
Definition constraint.h:267
The master of the optimization.
Definition master.h:69
Constraints defined by a number.
Definition numcon.h:46
virtual void print(std::ostream &out) const
Writes the row format of the constraint on an output stream.
Definition numcon.h:105
virtual ~NumCon()
The destructor.
Definition numcon.h:79
NumCon(Master *master, const Sub *sub, CSense::SENSE sense, bool dynamic, bool local, bool liftable, int number, double rhs)
Creates a constraint defined by number.
Definition numcon.h:67
int number_
The identification number of the constraint.
Definition numcon.h:114
virtual double coeff(const Variable *v) const
Returns the coefficient of the variable v.
Definition numcon.h:123
int number() const
Returns the identification number of the constraint.
Definition numcon.h:110
friend std::ostream & operator<<(std::ostream &out, const NumCon &rhs)
The output operator writes the identification number and the right hand side to an output stream.
Definition numcon.h:88
The subproblem.
Definition sub.h:68
Forms the virtual base class for all possible variables given in pool format.
Definition variable.h:59
virtual double coeff(const Constraint *con) const
Computes the coefficient of the variable in the constraint con.
Definition variable.h:188
colvar.
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition config.h:101
constraint.
static MultilevelBuilder * getDoubleFactoredZeroAdjustedMerger()