14 #ifndef OR_TOOLS_SAT_CUTS_H_
15 #define OR_TOOLS_SAT_CUTS_H_
41 std::vector<IntegerVariable>
vars;
61 : lp_vars_(lp_vars_.begin(), lp_vars_.end()),
62 integer_trail_(integer_trail),
63 implied_bounds_(implied_bounds) {}
79 std::vector<std::pair<IntegerVariable, IntegerValue>>
terms;
83 IntegerValue
lb = IntegerValue(0);
84 IntegerValue
ub = IntegerValue(0);
88 bool substitute_only_inner_variables, IntegerVariable first_slack,
104 const std::vector<SlackInfo>& info);
127 BestImpliedBoundInfo ComputeBestImpliedBound(
131 absl::flat_hash_set<IntegerVariable> lp_vars_;
132 mutable absl::flat_hash_map<IntegerVariable, BestImpliedBoundInfo> cache_;
141 mutable std::vector<std::pair<IntegerVariable, IntegerValue>> tmp_terms_;
173 IntegerValue
GetFactorT(IntegerValue rhs_remainder, IntegerValue divisor,
176 IntegerValue rhs_remainder, IntegerValue divisor, IntegerValue t,
177 IntegerValue max_scaling);
224 std::vector<int> relevant_indices_;
225 std::vector<double> relevant_lp_values_;
226 std::vector<IntegerValue> relevant_coeffs_;
227 std::vector<IntegerValue> relevant_bound_diffs_;
228 std::vector<IntegerValue> divisors_;
229 std::vector<std::pair<int, IntegerValue>> adjusted_coeffs_;
230 std::vector<IntegerValue> remainders_;
231 std::vector<bool> change_sign_at_postprocessing_;
232 std::vector<IntegerValue> rs_;
233 std::vector<IntegerValue> best_rs_;
235 int num_lifted_booleans_ = 0;
236 std::vector<std::pair<IntegerVariable, IntegerValue>> tmp_terms_;
245 const std::vector<double>& lp_values,
254 const std::string
Info() {
return absl::StrCat(
"lift=", num_lifting_); }
259 double dist_to_max_value;
260 IntegerValue positive_coeff;
263 std::vector<Term> terms_;
264 std::vector<bool> in_cut_;
266 LinearConstraint cut_;
275 const LinearConstraint& constraint,
277 const IntegerTrail& integer_trail);
283 const IntegerTrail& integer_trail);
299 const LinearConstraint& preprocessed_constraint,
301 const IntegerTrail& integer_trail);
320 const LinearConstraint& constraint,
322 const IntegerTrail& integer_trail);
328 const LinearConstraint& preprocessed_constraint,
330 const IntegerTrail& integer_trail);
340 std::vector<LinearConstraint>* knapsack_constraints,
341 IntegerTrail* integer_trail);
353 const LinearConstraint& constraint,
355 const std::vector<IntegerValue>& cut_vars_original_coefficients,
357 LinearConstraint* cut);
410 const std::vector<LinearConstraint>& base_constraints,
411 const std::vector<IntegerVariable>& vars, Model*
model);
431 const std::vector<IntegerVariable>& vars, Model*
model);
471 const IntegerVariable target,
const std::vector<LinearExpression>& exprs,
472 const std::vector<IntegerVariable>& z_vars, Model*
model);
487 const std::vector<IntervalVariable>& intervals,
488 const IntegerVariable
capacity,
const std::vector<IntegerVariable>& demands,
503 const std::vector<IntervalVariable>& intervals,
504 const IntegerVariable
capacity,
const std::vector<IntegerVariable>& demands,
517 const std::vector<IntervalVariable>& intervals, Model*
model);
522 const std::vector<IntervalVariable>& intervals, Model*
model);
528 const std::vector<IntegerVariable>& base_variables, Model*
model);
533 #endif // OR_TOOLS_SAT_CUTS_H_