53 struct AffineMapping {
60 : variable(nullptr),
coefficient(0), offset(0), constraint(nullptr) {}
61 AffineMapping(Variable* v, int64_t c, int64_t o,
Constraint*
ct)
70 struct Array2DIndexMapping {
75 Constraint* constraint;
82 constraint(nullptr) {}
83 Array2DIndexMapping(Variable* v1, int64_t c, Variable* v2, int64_t o,
93 void SubstituteEverywhere(Model*
model);
94 void SubstituteAnnotation(Annotation* ann);
97 void PresolveBool2Int(Constraint*
ct);
98 void PresolveInt2Float(Constraint*
ct);
99 void PresolveStoreAffineMapping(Constraint*
ct);
100 void PresolveStoreFlatteningMapping(Constraint*
ct);
101 void PresolveSimplifyElement(Constraint*
ct);
102 void PresolveSimplifyExprElement(Constraint*
ct);
105 void UpdateRuleStats(
const std::string& rule_name) {
106 successful_rules_[rule_name]++;
115 void AddVariableSubstitution(Variable* from, Variable*
to);
116 Variable* FindRepresentativeOfVar(Variable*
var);
117 absl::flat_hash_map<const Variable*, Variable*> var_representative_map_;
118 std::vector<Variable*> var_representative_vector_;
121 absl::flat_hash_map<const Variable*, AffineMapping> affine_map_;
124 absl::flat_hash_map<const Variable*, Array2DIndexMapping> array2d_index_map_;
128 std::map<std::string, int> successful_rules_;
130 SolverLogger* logger_;