Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
rowcon.h
Go to the documentation of this file.
1
30#pragma once
31
32#include <ogdf/lib/abacus/row.h>
35
36namespace abacus {
37
38
40
49class RowCon : public Constraint {
50public:
51
53
72 RowCon(Master *master,
73 const Sub *sub,
75 int nnz,
76 const Array<int> &support,
77 const Array<double> &coeff,
78 double rhs,
79 bool dynamic,
80 bool local,
81 bool liftable)
82 :
84 row_(master, nnz, support, coeff, sense, rhs)
85 { }
86
88
107 RowCon(Master *master,
108 const Sub *sub,
110 int nnz,
111 int *support,
112 double *coeff,
113 double rhs,
114 bool dynamic,
115 bool local,
116 bool liftable)
117 :
119 row_(master, nnz, support, coeff, sense, rhs)
120 { }
121
123 virtual ~RowCon() { }
124
126
136 virtual double coeff(const Variable *v) const override {
137 const NumVar *numVar = static_cast<const NumVar *>(v);
138 return row_.origCoeff(numVar->number());
139 }
140
142
147 virtual void print(std::ostream &out) const override {
148 out << row_;
149 }
150
152 Row *row() { return &row_; }
153
155 const Row *row() const { return &row_; }
156
157protected:
158
160};
161
162}
const Sub * sub() const
Returns a const pointer to the subproblem associated with the constraint/variable.
Definition convar.h:199
bool local() const
Returns true if the constraint/variable is only locally valid, false otherwise.
Definition convar.h:113
virtual bool dynamic() const
Return true if the constraint/variable is dynamic.
Definition convar.h:124
Forms the virtual base class for all possible constraints given in pool format.
Definition constraint.h:56
bool liftable() const
Checks if the constraint is liftable.
Definition constraint.h:140
CSense * sense()
Returns a pointer to the sense of the constraint.
Definition constraint.h:115
virtual double rhs() const
Returns the right hand side of the constraint.
Definition constraint.h:130
The master of the optimization.
Definition master.h:69
Variables identified by a number.
Definition numvar.h:42
Implements constraints stored in the class Row.
Definition rowcon.h:49
RowCon(Master *master, const Sub *sub, CSense::SENSE sense, int nnz, int *support, double *coeff, double rhs, bool dynamic, bool local, bool liftable)
Creates a row constraint.
Definition rowcon.h:107
const Row * row() const
Returns a const pointer to the object of the class Row representing the constraint.
Definition rowcon.h:155
Row * row()
Returns a pointer to the object of the class Row representing the constraint.
Definition rowcon.h:152
virtual void print(std::ostream &out) const override
Writes the row format of the constraint on an output stream.
Definition rowcon.h:147
Row row_
The representation of the constraint.
Definition rowcon.h:159
virtual ~RowCon()
The destructor.
Definition rowcon.h:123
RowCon(Master *master, const Sub *sub, CSense::SENSE sense, int nnz, const Array< int > &support, const Array< double > &coeff, double rhs, bool dynamic, bool local, bool liftable)
Creates a row constraint.
Definition rowcon.h:72
virtual double coeff(const Variable *v) const override
Computes the coefficient of a variable which must be of type NumVar.
Definition rowcon.h:136
Representation of constraints in the row format.
Definition row.h:51
double origCoeff(int i) const
The subproblem.
Definition sub.h:68
Forms the virtual base class for all possible variables given in pool format.
Definition variable.h:59
The parameterized class Array implements dynamic arrays of type E.
Definition Array.h:214
constraint.
static MultilevelBuilder * getDoubleFactoredZeroAdjustedMerger()
variable identified by a number.
row.