14 #ifndef OR_TOOLS_SAT_VAR_DOMINATION_H_
15 #define OR_TOOLS_SAT_VAR_DOMINATION_H_
63 void Reset(
int num_variables);
89 absl::Span<const int64> coeffs);
91 absl::Span<const int> refs,
92 absl::Span<const int64> coeffs);
94 absl::Span<const int> refs,
95 absl::Span<const int64> coeffs);
116 IntegerVariable
var)
const;
123 struct IntegerVariableWithRank {
128 bool operator<(
const IntegerVariableWithRank& o)
const {
129 return rank < o.rank;
134 void RefinePartition(std::vector<int>* vars);
137 void MakeRankEqualToStartOfPart(absl::Span<IntegerVariableWithRank> span);
138 void FillTempRanks(
bool reverse_references,
139 absl::Span<const int> enforcements,
140 absl::Span<const int> refs,
141 absl::Span<const int64> coeffs);
145 absl::Span<const IntegerVariable> InitialDominatingCandidates(
146 IntegerVariable
var)
const;
147 void ProcessTempRanks();
148 void Initialize(absl::Span<IntegerVariableWithRank> span);
151 void FilterUsingTempRanks();
154 void CheckUsingTempRanks();
166 std::vector<IntegerVariableWithRank> tmp_ranks_;
173 std::vector<int> tmp_vars_;
174 std::unique_ptr<DynamicPartition> partition_;
179 int64 ct_index_for_signature_ = 0;
183 int num_vars_with_negation_;
188 struct IntegerVariableSpan {
195 std::vector<IntegerVariable> shared_buffer_;
200 std::vector<IntegerVariable> buffer_;
223 template <
typename LinearProto>
226 const LinearProto& linear,
int64 min_activity,
236 return can_freely_decrease_until_[RefToIntegerVariable(ref)].value();
241 static IntegerVariable RefToIntegerVariable(
int ref) {
254 VarDomination* var_domination,
255 DualBoundStrengthening* dual_bound_strengthening);
267 #endif // OR_TOOLS_SAT_VAR_DOMINATION_H_