Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
srowcon.h
Go to the documentation of this file.
1
30#pragma once
31
33
34#pragma GCC visibility push(default)
35namespace abacus {
36
38
44class SRowCon : public RowCon {
45public:
46
48
67 SRowCon(Master *master,
68 const Sub *sub,
70 int nnz,
71 const Array<int> &support,
72 const Array<double> &coeff,
73 double rhs,
74 bool dynamic,
75 bool local,
76 bool liftable)
77 : RowCon(master, sub, sense, nnz, support, coeff, rhs, dynamic, local, liftable)
78 { }
79
81
101 const Sub *sub,
103 int nnz,
104 int *support,
105 double *coeff,
106 double rhs,
107 bool dynamic,
108 bool local,
109 bool liftable)
110 : RowCon(master, sub, sense, nnz, support, coeff, rhs, dynamic, local, liftable)
111 { }
112
114 virtual ~SRowCon() { }
115
117
127 virtual int genRow(Active<Variable, Constraint> *var, Row &row) const override {
128 row.copy(row_);
129 return row_.nnz();
130 }
131
133
143 virtual double slack(Active<Variable, Constraint> *variables,
144 double *x) const override;
145};
146
147}
148#pragma GCC visibility pop
Implements the sets of active constraints and variables which are associated with each subproblem.
Definition active.h:63
const Sub * sub() const
Returns a const pointer to the subproblem associated with the constraint/variable.
Definition convar.h:200
bool local() const
Returns true if the constraint/variable is only locally valid, false otherwise.
Definition convar.h:114
virtual bool dynamic() const
Return true if the constraint/variable is dynamic.
Definition convar.h:125
bool liftable() const
Checks if the constraint is liftable.
Definition constraint.h:141
CSense * sense()
Returns a pointer to the sense of the constraint.
Definition constraint.h:116
virtual double rhs() const
Returns the right hand side of the constraint.
Definition constraint.h:131
The master of the optimization.
Definition master.h:70
Implements constraints stored in the class Row.
Definition rowcon.h:50
Row * row()
Returns a pointer to the object of the class Row representing the constraint.
Definition rowcon.h:153
Row row_
The representation of the constraint.
Definition rowcon.h:160
virtual double coeff(const Variable *v) const override
Computes the coefficient of a variable which must be of type NumVar.
Definition rowcon.h:137
Representation of constraints in the row format.
Definition row.h:52
void copy(const Row &row)
Copies row.
Constraints using row with static variable set.
Definition srowcon.h:44
virtual int genRow(Active< Variable, Constraint > *var, Row &row) const override
Generates the row format of the constraint associated with the variable set var.
Definition srowcon.h:127
virtual double slack(Active< Variable, Constraint > *variables, double *x) const override
Computes the slack of a vector associated with the variable set variables.
virtual ~SRowCon()
The destructor.
Definition srowcon.h:114
SRowCon(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 srowcon.h:67
SRowCon(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 srowcon.h:100
int nnz() const
Returns the number of nonzero elements.
Definition sparvec.h:233
The subproblem.
Definition sub.h:69
The parameterized class Array implements dynamic arrays of type E.
Definition Array.h:219
constraint using row.