Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
|
#include <pb_constraint.h>
Public Member Functions | |
CanonicalBooleanLinearProblem ()=default | |
CanonicalBooleanLinearProblem (const CanonicalBooleanLinearProblem &)=delete | |
This type is neither copyable nor movable. | |
CanonicalBooleanLinearProblem & | operator= (const CanonicalBooleanLinearProblem &)=delete |
bool | AddLinearConstraint (bool use_lower_bound, Coefficient lower_bound, bool use_upper_bound, Coefficient upper_bound, std::vector< LiteralWithCoeff > *cst) |
int | NumConstraints () const |
Getters. All the constraints are guaranteed to be in canonical form. | |
Coefficient | Rhs (int i) const |
const std::vector< LiteralWithCoeff > & | Constraint (int i) const |
Holds a set of boolean linear constraints in canonical form:
The linear sum satisfies the properties described in ComputeBooleanLinearExpressionCanonicalForm().
Definition at line 150 of file pb_constraint.h.
|
default |
|
delete |
This type is neither copyable nor movable.
bool operations_research::sat::CanonicalBooleanLinearProblem::AddLinearConstraint | ( | bool | use_lower_bound, |
Coefficient | lower_bound, | ||
bool | use_upper_bound, | ||
Coefficient | upper_bound, | ||
std::vector< LiteralWithCoeff > * | cst ) |
Adds a new constraint to the problem. The bounds are inclusive. Returns false in case of a possible overflow or if the constraint is never satisfiable.
Canonicalize the linear expression of the constraint.
We transform the constraint into an upper-bounded one.
Definition at line 215 of file pb_constraint.cc.
|
inline |
Definition at line 171 of file pb_constraint.h.
|
inline |
Getters. All the constraints are guaranteed to be in canonical form.
Definition at line 169 of file pb_constraint.h.
|
delete |
|
inline |
Definition at line 170 of file pb_constraint.h.