14 #ifndef OR_TOOLS_SAT_FEASIBILITY_PUMP_H_
15 #define OR_TOOLS_SAT_FEASIBILITY_PUMP_H_
42 max_fp_iterations_ =
std::max(1, max_iter);
67 return integer_solution_objective_;
70 return integer_solution_is_feasible_;
87 bool NearestIntegerRounding();
98 bool LockBasedRounding();
102 bool ActiveLockBasedRounding();
114 bool PropagationRounding();
116 void FillIntegerSolutionStats();
119 void InitializeWorkingLP();
123 void L1DistanceMinimize();
127 void MaybePushToRepo();
132 double GetVariableValueAtCpScale(glop::ColIndex
var);
135 using LinearExpression = std::vector<std::pair<glop::ColIndex, IntegerValue>>;
139 glop::ColIndex GetOrCreateMirrorVariable(IntegerVariable positive_variable);
142 void UpdateBoundsOfLpVariables();
147 static const double kCpEpsilon;
151 struct LinearConstraintInternal {
156 LinearExpression integer_objective_;
157 IntegerValue objective_infinity_norm_ = IntegerValue(0);
158 double objective_normalization_factor_ = 0.0;
159 double mixing_factor_ = 1.0;
162 int model_vars_size_ = 0;
179 std::vector<IntegerVariable> integer_variables_;
180 absl::flat_hash_map<IntegerVariable, glop::ColIndex> mirror_lp_variable_;
183 std::vector<bool> var_is_binary_;
188 std::vector<int> var_up_locks_;
189 std::vector<int> var_down_locks_;
193 bool objective_is_defined_ =
false;
196 const SatParameters& sat_parameters_;
198 IntegerTrail* integer_trail_;
200 IntegerEncoder* integer_encoder_;
201 SharedIncompleteSolutionManager* incomplete_solutions_;
202 SatSolver* sat_solver_;
203 IntegerDomains* domains_;
204 const CpModelMapping* mapping_;
207 bool lp_solution_is_set_ =
false;
208 bool lp_solution_is_integer_ =
false;
209 double lp_objective_;
210 std::vector<double> lp_solution_;
211 std::vector<double> best_lp_solution_;
213 double lp_solution_fractionality_;
216 bool integer_solution_is_set_ =
false;
217 bool integer_solution_is_feasible_ =
false;
218 int64_t integer_solution_objective_;
219 std::vector<int64_t> integer_solution_;
220 std::vector<int64_t> best_integer_solution_;
221 int num_infeasible_constraints_;
223 int64_t integer_solution_infeasibility_;
227 int64_t total_num_simplex_iterations_ = 0;
230 int max_fp_iterations_ = 20;
232 bool model_is_unsat_ =
false;
A simple class to enforce both an elapsed time limit and a deterministic time limit in the same threa...
bool HasIntegerSolution() const
double LPSolutionFractionality() const
void SetMaxFPIterations(int max_iter)
FeasibilityPump(Model *model)
double LPSolutionObjectiveValue() const
int64_t IntegerSolutionObjectiveValue() const
glop::RowIndex ConstraintIndex
double GetLPSolutionValue(IntegerVariable variable) const
int64_t GetIntegerSolutionValue(IntegerVariable variable) const
void AddLinearConstraint(const LinearConstraint &ct)
bool IntegerSolutionIsFeasible() const
bool HasLPSolution() const
void SetObjectiveCoefficient(IntegerVariable ivar, IntegerValue coeff)
bool LPSolutionIsInteger() const
Class that owns everything related to a particular optimization model.
Collection of objects used to extend the Constraint Solver library.