Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

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 }
abacus::Active
Implements the sets of active constraints and variables which are associated with each subproblem.
Definition: active.h:43
abacus::ConVar::local
bool local() const
Returns true if the constraint/variable is only locally valid, false otherwise.
Definition: convar.h:113
abacus::RowCon::row_
Row row_
The representation of the constraint.
Definition: rowcon.h:159
abacus::SRowCon::slack
virtual double slack(Active< Variable, Constraint > *variables, double *x) const override
Computes the slack of a vector associated with the variable set variables.
abacus::ConVar::sub
const Sub * sub() const
Returns a const pointer to the subproblem associated with the constraint/variable.
Definition: convar.h:199
rowcon.h
constraint using row.
abacus::Constraint::rhs
virtual double rhs() const
Returns the right hand side of the constraint.
Definition: constraint.h:130
abacus
Definition: abacusroot.h:48
abacus::SparVec::nnz
int nnz() const
Returns the number of nonzero elements.
Definition: sparvec.h:232
abacus::Row::copy
void copy(const Row &row)
Copies row.
abacus::Constraint::liftable
bool liftable() const
Checks if the constraint is liftable.
Definition: constraint.h:140
abacus::SRowCon::genRow
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
abacus::RowCon::coeff
virtual double coeff(const Variable *v) const override
Computes the coefficient of a variable which must be of type NumVar.
Definition: rowcon.h:136
abacus::ConVar::dynamic
virtual bool dynamic() const
Return true if the constraint/variable is dynamic.
Definition: convar.h:124
abacus::RowCon
Implements constraints stored in the class Row.
Definition: rowcon.h:49
abacus::RowCon::row
Row * row()
Returns a pointer to the object of the class Row representing the constraint.
Definition: rowcon.h:152
ogdf::Array
The parameterized class Array implements dynamic arrays of type E.
Definition: Array.h:214
abacus::Row
Representation of constraints in the row format.
Definition: row.h:51
abacus::Constraint::sense
CSense * sense()
Returns a pointer to the sense of the constraint.
Definition: constraint.h:115
abacus::SRowCon::SRowCon
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
abacus::SRowCon
Constraints using row with static variable set.
Definition: srowcon.h:43
abacus::Sub
The subproblem.
Definition: sub.h:68
Minisat::Internal::var
int var(Lit p)
Definition: SolverTypes.h:61
abacus::CSense::SENSE
SENSE
Definition: csense.h:51
abacus::Master
The master of the optimization.
Definition: master.h:69
abacus::SRowCon::SRowCon
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
abacus::SRowCon::~SRowCon
virtual ~SRowCon()
The destructor.
Definition: srowcon.h:113