C++ Reference: class CanonicalBooleanLinearProblem

This documentation is automatically generated.

Holds a set of boolean linear constraints in canonical form:
   - The constraint is a linear sum of LiteralWithCoeff <= rhs.
   - The linear sum satisfies the properties described in ComputeBooleanLinearExpressionCanonicalForm().


TODO(user): Simplify further the constraints.

TODO(user): Remove the duplication between this and what the sat solver is doing in AddLinearConstraint() which is basically the same.

TODO(user): Remove duplicate constraints? some problems have them, and this is not ideal for the symmetry computation since it leads to a lot of symmetries of the associated graph that are not useful.
Method
AddLinearConstraint

Return type: bool

Arguments: 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. TODO(user): Use a return status to distinguish errors if needed.

CanonicalBooleanLinearProblem

Constraint

Return type: const std::vector<LiteralWithCoeff>&

Arguments: int i

NumConstraints

Return type: int

Getters. All the constraints are guaranteed to be in canonical form.

Rhs

Return type: const Coefficient

Arguments: int i