Open
Graph Drawing
Framework

 v. snapshot-2017-02-16
 

srowcon.h
Go to the documentation of this file.
1 
30 #pragma once
31 
32 #include <ogdf/lib/abacus/rowcon.h>
33 
34 namespace abacus {
35 
37 
43 class SRowCon : public RowCon {
44 public:
45 
47 
66  SRowCon(Master *master,
67  const Sub *sub,
69  int nnz,
70  const Array<int> &support,
71  const Array<double> &coeff,
72  double rhs,
73  bool dynamic,
74  bool local,
75  bool liftable)
76  : RowCon(master, sub, sense, nnz, support, coeff, rhs, dynamic, local, liftable)
77  { }
78 
80 
99  SRowCon(Master *master,
100  const Sub *sub,
102  int nnz,
103  int *support,
104  double *coeff,
105  double rhs,
106  bool dynamic,
107  bool local,
108  bool liftable)
109  : RowCon(master, sub, sense, nnz, support, coeff, rhs, dynamic, local, liftable)
110  { }
111 
113  virtual ~SRowCon() { }
114 
116 
126  virtual int genRow(Active<Variable, Constraint> *var, Row &row) const override {
127  row.copy(row_);
128  return row_.nnz();
129  }
130 
132 
142  virtual double slack(Active<Variable, Constraint> *variables,
143  double *x) const override;
144 };
145 
146 } //namespace abacus
CSense * sense()
Returns a pointer to the sense of the constraint.
Definition: constraint.h:115
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:126
Representation of constraints in the row format.
Definition: row.h:51
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:66
The master of the optimization.
Definition: master.h:69
Implements the sets of active constraints and variables which are associated with each subproblem...
Definition: active.h:43
virtual double rhs() const
Returns the right hand side of the constraint.
Definition: constraint.h:130
virtual ~SRowCon()
The destructor.
Definition: srowcon.h:113
Constraints using row with static variable set.
Definition: srowcon.h:43
The subproblem.
Definition: sub.h:68
Row * row()
Returns a pointer to the object of the class Row representing the constraint.
Definition: rowcon.h:152
virtual double coeff(const Variable *v) const override
Computes the coefficient of a variable which must be of type NumVar.
Definition: rowcon.h:136
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:99
constraint using row.
bool local() const
Returns true if the constraint/variable is only locally valid, false otherwise.
Definition: convar.h:113
int var(Lit p)
Definition: SolverTypes.h:61
virtual bool dynamic() const
Return true if the constraint/variable is dynamic.
Definition: convar.h:124
bool liftable() const
Checks if the constraint is liftable.
Definition: constraint.h:140
Implements constraints stored in the class Row.
Definition: rowcon.h:49
void copy(const Row &row)
Copies row.
Row row_
The representation of the constraint.
Definition: rowcon.h:159
virtual double slack(Active< Variable, Constraint > *variables, double *x) const override
Computes the slack of a vector associated with the variable set variables.
int nnz() const
Returns the number of nonzero elements.
Definition: sparvec.h:232
const Sub * sub() const
Returns a const pointer to the subproblem associated with the constraint/variable.
Definition: convar.h:199