14#ifndef OR_TOOLS_SAT_CP_MODEL_PRESOLVE_H_
15#define OR_TOOLS_SAT_CP_MODEL_PRESOLVE_H_
41 const PresolveContext&
context);
67 std::vector<int>* postsolve_mapping);
82 void PresolveToFixPoint();
133 template <
typename ProtoWithVarsAndCoeffs>
135 ProtoWithVarsAndCoeffs*
proto,
153 bool ProcessSetPPC();
158 bool ProcessSetPPCSubset(
int c1,
int c2,
const std::vector<int>& c2_minus_c1,
159 const std::vector<int>& original_constraint_index,
160 std::vector<bool>* marked_for_removal);
162 void PresolvePureSatPart();
169 void ExtractEnforcementLiteralFromLinearConstraint(
int ct_index,
174 void TransformIntoMaxCliques();
177 void ExtractBoolAnd();
179 void ExpandObjective();
181 void TryToSimplifyDomain(
int var);
183 void MergeNoOverlapConstraints();
187 void EncodeAllAffineRelations();
188 bool PresolveAffineRelationIfAny(
int var);
195 std::vector<int>* postsolve_mapping_;
200 std::vector<std::pair<int, int64_t>> tmp_terms_;
225 const std::vector<int>& ignored_constraints);
229 bool CreateUnsatModel();
244 int64_t skipped_non_zero_ = 0;
247 std::vector<int> non_fixed_variables_;
248 std::vector<int64_t> non_fixed_coefficients_;
249 absl::flat_hash_map<int, int> interval_mapping_;
250 int starting_constraint_index_ = 0;
251 std::vector<int> temp_enforcement_literals_;
252 std::vector<int> temp_literals_;
267 std::vector<int>* postsolve_mapping);
void RemoveEmptyConstraints()
CpModelPresolver(PresolveContext *context, std::vector< int > *postsolve_mapping)
bool PresolveOneConstraint(int c)
ModelCopy(PresolveContext *context)
bool ImportAndSimplifyConstraints(const CpModelProto &in_model, const std::vector< int > &ignored_constraints)
CpModelProto const * model_proto
GurobiMPCallbackContext * context
bool PresolveCpModel(PresolveContext *context, std::vector< int > *postsolve_mapping)
void CopyEverythingExceptVariablesAndConstraintsFieldsIntoContext(const CpModelProto &in_model, PresolveContext *context)
bool ImportConstraintsWithBasicPresolveIntoContext(const CpModelProto &in_model, PresolveContext *context)
std::vector< std::pair< int, int > > FindDuplicateConstraints(const CpModelProto &model_proto)
void ApplyVariableMapping(const std::vector< int > &mapping, const PresolveContext &context)
Collection of objects used to extend the Constraint Solver library.