14 #ifndef OR_TOOLS_SAT_FEASIBILITY_PUMP_H_
15 #define OR_TOOLS_SAT_FEASIBILITY_PUMP_H_
39 max_fp_iterations_ =
std::max(1, max_iter);
64 return integer_solution_objective_;
67 return integer_solution_is_feasible_;
84 bool NearestIntegerRounding();
95 bool LockBasedRounding();
99 bool ActiveLockBasedRounding();
111 bool PropagationRounding();
113 void FillIntegerSolutionStats();
116 void InitializeWorkingLP();
120 void L1DistanceMinimize();
124 void MaybePushToRepo();
129 double GetVariableValueAtCpScale(glop::ColIndex
var);
132 using LinearExpression = std::vector<std::pair<glop::ColIndex, IntegerValue>>;
136 glop::ColIndex GetOrCreateMirrorVariable(IntegerVariable positive_variable);
139 void UpdateBoundsOfLpVariables();
144 static const double kCpEpsilon;
148 struct LinearConstraintInternal {
153 LinearExpression integer_objective_;
154 IntegerValue objective_infinity_norm_ = IntegerValue(0);
155 double objective_normalization_factor_ = 0.0;
156 double mixing_factor_ = 1.0;
159 int model_vars_size_ = 0;
176 std::vector<IntegerVariable> integer_variables_;
177 absl::flat_hash_map<IntegerVariable, glop::ColIndex> mirror_lp_variable_;
180 std::vector<bool> var_is_binary_;
185 std::vector<int> var_up_locks_;
186 std::vector<int> var_down_locks_;
190 bool objective_is_defined_ =
false;
193 const SatParameters& sat_parameters_;
195 IntegerTrail* integer_trail_;
197 IntegerEncoder* integer_encoder_;
198 SharedIncompleteSolutionManager* incomplete_solutions_;
199 SatSolver* sat_solver_;
200 IntegerDomains* domains_;
201 const CpModelMapping* mapping_;
204 bool lp_solution_is_set_ =
false;
205 bool lp_solution_is_integer_ =
false;
206 double lp_objective_;
207 std::vector<double> lp_solution_;
208 std::vector<double> best_lp_solution_;
210 double lp_solution_fractionality_;
213 bool integer_solution_is_set_ =
false;
214 bool integer_solution_is_feasible_ =
false;
215 int64 integer_solution_objective_;
216 std::vector<int64> integer_solution_;
217 std::vector<int64> best_integer_solution_;
218 int num_infeasible_constraints_;
220 int64 integer_solution_infeasibility_;
224 int64 total_num_simplex_iterations_ = 0;
227 int max_fp_iterations_ = 20;
229 bool model_is_unsat_ =
false;
235 #endif // OR_TOOLS_SAT_FEASIBILITY_PUMP_H_