14 #ifndef OR_TOOLS_SAT_CUTS_H_
15 #define OR_TOOLS_SAT_CUTS_H_
41 std::vector<IntegerVariable>
vars;
60 : lp_vars_(lp_vars_.begin(), lp_vars_.end()),
61 integer_trail_(integer_trail),
62 implied_bounds_(implied_bounds) {}
78 std::vector<std::pair<IntegerVariable, IntegerValue>>
terms;
82 IntegerValue
lb = IntegerValue(0);
83 IntegerValue
ub = IntegerValue(0);
87 bool substitute_only_inner_variables, IntegerVariable first_slack,
103 const std::vector<SlackInfo>& info);
126 BestImpliedBoundInfo ComputeBestImpliedBound(
130 absl::flat_hash_set<IntegerVariable> lp_vars_;
131 mutable absl::flat_hash_map<IntegerVariable, BestImpliedBoundInfo> cache_;
140 mutable std::vector<std::pair<IntegerVariable, IntegerValue>> tmp_terms_;
172 IntegerValue
GetFactorT(IntegerValue rhs_remainder, IntegerValue divisor,
175 IntegerValue rhs_remainder, IntegerValue divisor, IntegerValue t,
176 IntegerValue max_scaling);
223 std::vector<int> relevant_indices_;
224 std::vector<double> relevant_lp_values_;
225 std::vector<IntegerValue> relevant_coeffs_;
226 std::vector<IntegerValue> relevant_bound_diffs_;
227 std::vector<IntegerValue> divisors_;
228 std::vector<std::pair<int, IntegerValue>> adjusted_coeffs_;
229 std::vector<IntegerValue> remainders_;
230 std::vector<bool> change_sign_at_postprocessing_;
231 std::vector<IntegerValue> rs_;
232 std::vector<IntegerValue> best_rs_;
234 int num_lifted_booleans_ = 0;
235 std::vector<std::pair<IntegerVariable, IntegerValue>> tmp_terms_;
244 const std::vector<double>& lp_values,
253 const std::string
Info() {
return absl::StrCat(
"lift=", num_lifting_); }
258 double dist_to_max_value;
259 IntegerValue positive_coeff;
262 std::vector<Term> terms_;
263 std::vector<bool> in_cut_;
265 LinearConstraint cut_;
274 const LinearConstraint& constraint,
276 const IntegerTrail& integer_trail);
282 const IntegerTrail& integer_trail);
298 const LinearConstraint& preprocessed_constraint,
300 const IntegerTrail& integer_trail);
319 const LinearConstraint& constraint,
321 const IntegerTrail& integer_trail);
327 const LinearConstraint& preprocessed_constraint,
329 const IntegerTrail& integer_trail);
339 std::vector<LinearConstraint>* knapsack_constraints,
340 IntegerTrail* integer_trail);
352 const LinearConstraint& constraint,
354 const std::vector<IntegerValue>& cut_vars_original_coefficients,
356 LinearConstraint* cut);
409 const std::vector<LinearConstraint>& base_constraints,
410 const std::vector<IntegerVariable>& vars, Model*
model);
430 const std::vector<IntegerVariable>& vars, Model*
model);
470 const IntegerVariable target,
const std::vector<LinearExpression>& exprs,
471 const std::vector<IntegerVariable>& z_vars, Model*
model);
486 const std::vector<IntervalVariable>& intervals,
487 const IntegerVariable
capacity,
const std::vector<IntegerVariable>& demands,
502 const std::vector<IntervalVariable>& intervals,
503 const IntegerVariable
capacity,
const std::vector<IntegerVariable>& demands,
516 const std::vector<IntervalVariable>& intervals, Model*
model);
521 const std::vector<IntervalVariable>& intervals, Model*
model);
527 const std::vector<IntegerVariable>& base_variables, Model*
model);
532 #endif // OR_TOOLS_SAT_CUTS_H_