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
38#pragma GCC visibility push(default)
39namespace abacus {
40
41
43
48public:
49
51
68 NumCon(Master *master,
69 const Sub *sub,
70 CSense::SENSE sense,
71 bool dynamic,
72 bool local,
73 bool liftable,
74 int number,
75 double rhs)
76 : Constraint(master, sub, sense, rhs, dynamic, local, liftable), number_(number)
77 { }
78
80 virtual ~NumCon() { }
81
83
89 friend std::ostream &operator<<(std::ostream &out, const NumCon &rhs) {
90 return out << "number = " << rhs.number_ << " rhs = " << rhs.rhs_ << std::endl;
91 }
92
94
98 virtual double coeff(const Variable *v) const;
99
101
106 virtual void print(std::ostream &out) const {
107 out << *this;
108 }
109
111 int number() const { return number_; }
112
113
114private:
116};
117
118}
119#pragma GCC visibility pop
120
122
123#pragma GCC visibility push(default)
124namespace abacus {
125
126inline double NumCon::coeff(const Variable *v) const
127{
128 const ColVar *colvar = (const ColVar *) v;
129 return colvar->coeff(number_);
130}
131
132}
133#pragma GCC visibility pop
Some optimization problems, in particular column generation problems, are better described from a var...
Definition colvar.h:57
virtual double coeff(const Constraint *con) const
Returns the coefficient of the constraint con.
Definition colvar.h:153
Forms the virtual base class for all possible constraints given in pool format.
Definition constraint.h:57
double rhs_
The right hand side of the constraint.
Definition constraint.h:268
The master of the optimization.
Definition master.h:70
Constraints defined by a number.
Definition numcon.h:47
virtual void print(std::ostream &out) const
Writes the row format of the constraint on an output stream.
Definition numcon.h:106
virtual ~NumCon()
The destructor.
Definition numcon.h:80
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:68
int number_
The identification number of the constraint.
Definition numcon.h:115
virtual double coeff(const Variable *v) const
Returns the coefficient of the variable v.
Definition numcon.h:126
int number() const
Returns the identification number of the constraint.
Definition numcon.h:111
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:89
The subproblem.
Definition sub.h:69
Forms the virtual base class for all possible variables given in pool format.
Definition variable.h:60
colvar.
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF dynamic library (shared object / DLL),...
Definition config.h:117
constraint.