![]() |
OR-Tools
9.6
|
Definition at line 83 of file presolve_context.h.
Public Member Functions | |
| PresolveContext (Model *model, CpModelProto *cp_model, CpModelProto *mapping) | |
| int | NewIntVar (const Domain &domain) |
| int | NewBoolVar () |
| int | GetTrueLiteral () |
| int | GetFalseLiteral () |
| void | AddImplication (int a, int b) |
| void | AddImplyInDomain (int b, int x, const Domain &domain) |
| bool | DomainIsEmpty (int ref) const |
| bool | IsFixed (int ref) const |
| bool | CanBeUsedAsLiteral (int ref) const |
| bool | LiteralIsTrue (int lit) const |
| bool | LiteralIsFalse (int lit) const |
| int64_t | MinOf (int ref) const |
| int64_t | MaxOf (int ref) const |
| int64_t | FixedValue (int ref) const |
| bool | DomainContains (int ref, int64_t value) const |
| Domain | DomainOf (int ref) const |
| bool | IntervalIsConstant (int ct_ref) const |
| int64_t | StartMin (int ct_ref) const |
| int64_t | StartMax (int ct_ref) const |
| int64_t | SizeMin (int ct_ref) const |
| int64_t | SizeMax (int ct_ref) const |
| int64_t | EndMin (int ct_ref) const |
| int64_t | EndMax (int ct_ref) const |
| std::string | IntervalDebugString (int ct_ref) const |
| int64_t | MinOf (const LinearExpressionProto &expr) const |
| int64_t | MaxOf (const LinearExpressionProto &expr) const |
| bool | IsFixed (const LinearExpressionProto &expr) const |
| int64_t | FixedValue (const LinearExpressionProto &expr) const |
| template<typename ProtoWithVarsAndCoeffs > | |
| std::pair< int64_t, int64_t > | ComputeMinMaxActivity (const ProtoWithVarsAndCoeffs &proto) const |
| bool | DomainContains (const LinearExpressionProto &expr, int64_t value) const |
| Domain | DomainSuperSetOf (const LinearExpressionProto &expr) const |
| bool | ExpressionIsAffineBoolean (const LinearExpressionProto &expr) const |
| int | LiteralForExpressionMax (const LinearExpressionProto &expr) const |
| bool | ExpressionIsSingleVariable (const LinearExpressionProto &expr) const |
| bool | ExpressionIsALiteral (const LinearExpressionProto &expr, int *literal=nullptr) const |
| bool | DomainOfVarIsIncludedIn (int var, const Domain &domain) |
| bool | VariableIsUniqueAndRemovable (int ref) const |
| bool | VariableIsNotUsedAnymore (int ref) const |
| void | MarkVariableAsRemoved (int ref) |
| bool | VariableWasRemoved (int ref) const |
| bool | VariableWithCostIsUnique (int ref) const |
| bool | VariableWithCostIsUniqueAndRemovable (int ref) const |
| bool | VariableIsOnlyUsedInEncodingAndMaybeInObjective (int ref) const |
| ABSL_MUST_USE_RESULT bool | IntersectDomainWith (int ref, const Domain &domain, bool *domain_modified=nullptr) |
| ABSL_MUST_USE_RESULT bool | SetLiteralToFalse (int lit) |
| ABSL_MUST_USE_RESULT bool | SetLiteralToTrue (int lit) |
| ABSL_MUST_USE_RESULT bool | IntersectDomainWith (const LinearExpressionProto &expr, const Domain &domain, bool *domain_modified=nullptr) |
| ABSL_MUST_USE_RESULT bool | NotifyThatModelIsUnsat (const std::string &message="") |
| bool | ModelIsUnsat () const |
| void | UpdateRuleStats (const std::string &name, int num_times=1) |
| void | UpdateConstraintVariableUsage (int c) |
| bool | ConstraintVariableGraphIsUpToDate () const |
| void | UpdateNewConstraintsVariableUsage () |
| bool | ConstraintVariableUsageIsConsistent () |
| void | CanonicalizeVariable (int ref) |
| bool | CanonicalizeAffineVariable (int ref, int64_t coeff, int64_t mod, int64_t rhs) |
| bool | StoreAffineRelation (int ref_x, int ref_y, int64_t coeff, int64_t offset, bool debug_no_recursion=false) |
| bool | StoreBooleanEqualityRelation (int ref_a, int ref_b) |
| bool | StoreAbsRelation (int target_ref, int ref) |
| bool | GetAbsRelation (int target_ref, int *ref) |
| int | GetLiteralRepresentative (int ref) const |
| int | GetVariableRepresentative (int ref) const |
| int | NumAffineRelations () const |
| AffineRelation::Relation | GetAffineRelation (int ref) const |
| std::string | RefDebugString (int ref) const |
| std::string | AffineRelationDebugString (int ref) const |
| bool | PropagateAffineRelation (int ref) |
| bool | PropagateAffineRelation (int ref, int rep, int64_t coeff, int64_t offset) |
| void | InitializeNewDomains () |
| void | ClearStats () |
| bool | InsertVarValueEncoding (int literal, int ref, int64_t value) |
| int | GetOrCreateVarValueEncoding (int ref, int64_t value) |
| int | GetOrCreateAffineValueEncoding (const LinearExpressionProto &expr, int64_t value) |
| void | CanonicalizeDomainOfSizeTwo (int var) |
| bool | HasVarValueEncoding (int ref, int64_t value, int *literal=nullptr) |
| bool | IsFullyEncoded (int ref) const |
| bool | IsFullyEncoded (const LinearExpressionProto &expr) const |
| bool | StoreLiteralImpliesVarEqValue (int literal, int var, int64_t value) |
| bool | StoreLiteralImpliesVarNEqValue (int literal, int var, int64_t value) |
| void | ReadObjectiveFromProto () |
| bool | AddToObjectiveOffset (int64_t delta) |
| ABSL_MUST_USE_RESULT bool | CanonicalizeOneObjectiveVariable (int var) |
| ABSL_MUST_USE_RESULT bool | CanonicalizeObjective (bool simplify_domain=true) |
| void | WriteObjectiveToProto () const |
| ABSL_MUST_USE_RESULT bool | ScaleFloatingPointObjective () |
| bool | RecomputeSingletonObjectiveDomain () |
| void | WriteVariableDomainsToProto () const |
| bool | ExploitExactlyOneInObjective (absl::Span< const int > exactly_one) |
| bool | ShiftCostInExactlyOne (absl::Span< const int > exactly_one, int64_t shift) |
| void | RemoveVariableFromObjective (int ref) |
| void | AddToObjective (int var, int64_t value) |
| void | AddLiteralToObjective (int ref, int64_t value) |
| ABSL_MUST_USE_RESULT bool | SubstituteVariableInObjective (int var_in_equality, int64_t coeff_in_equality, const ConstraintProto &equality) |
| const Domain & | ObjectiveDomain () const |
| const absl::flat_hash_map< int, int64_t > & | ObjectiveMap () const |
| int64_t | ObjectiveCoeff (int var) const |
| bool | ObjectiveDomainIsConstraining () const |
| void | RemoveVariableFromAffineRelation (int var) |
| void | RemoveAllVariablesFromAffineRelationConstraint () |
| const std::vector< std::vector< int > > & | ConstraintToVarsGraph () const |
| const std::vector< int > & | ConstraintToVars (int c) const |
| const absl::flat_hash_set< int > & | VarToConstraints (int var) const |
| int | IntervalUsage (int c) const |
| bool | ConstraintIsInactive (int ct_index) const |
| bool | ConstraintIsOptional (int ct_ref) const |
| void | RegisterVariablesUsedInAssumptions () |
| bool | ModelIsExpanded () const |
| void | NotifyThatModelIsExpanded () |
| int | GetOrCreateReifiedPrecedenceLiteral (const LinearExpressionProto &time_i, const LinearExpressionProto &time_j, int active_i, int active_j) |
| std::tuple< int, int64_t, int, int64_t, int64_t, int, int > | GetReifiedPrecedenceKey (const LinearExpressionProto &time_i, const LinearExpressionProto &time_j, int active_i, int active_j) |
| void | ClearPrecedenceCache () |
| void | LogInfo () |
| int | GetIntervalRepresentative (int index) |
| SolverLogger * | logger () const |
| const SatParameters & | params () const |
| TimeLimit * | time_limit () |
| ModelRandomGenerator * | random () |
Public Attributes | |
| CpModelProto * | working_model = nullptr |
| CpModelProto * | mapping_model = nullptr |
| bool | keep_all_feasible_solutions = false |
| int64_t | num_presolve_operations = 0 |
| std::vector< int > | tmp_literals |
| std::vector< Domain > | tmp_term_domains |
| std::vector< Domain > | tmp_left_domains |
| absl::flat_hash_set< int > | tmp_literal_set |
| SparseBitset< int > | modified_domains |
| SparseBitset< int > | var_with_reduced_small_degree |
| DomainDeductions | deductions |
|
inline |
Definition at line 85 of file presolve_context.h.
| void AddImplication | ( | int | a, |
| int | b | ||
| ) |
Definition at line 84 of file presolve_context.cc.
| void AddImplyInDomain | ( | int | b, |
| int | x, | ||
| const Domain & | domain | ||
| ) |
Definition at line 91 of file presolve_context.cc.
| void AddLiteralToObjective | ( | int | ref, |
| int64_t | value | ||
| ) |
Definition at line 1727 of file presolve_context.cc.
| void AddToObjective | ( | int | var, |
| int64_t | value | ||
| ) |
Definition at line 1716 of file presolve_context.cc.
| bool AddToObjectiveOffset | ( | int64_t | delta | ) |
Definition at line 1743 of file presolve_context.cc.
| std::string AffineRelationDebugString | ( | int | ref | ) | const |
Definition at line 1154 of file presolve_context.cc.
| bool CanBeUsedAsLiteral | ( | int | ref | ) | const |
Definition at line 113 of file presolve_context.cc.
| bool CanonicalizeAffineVariable | ( | int | ref, |
| int64_t | coeff, | ||
| int64_t | mod, | ||
| int64_t | rhs | ||
| ) |
Definition at line 817 of file presolve_context.cc.
| void CanonicalizeDomainOfSizeTwo | ( | int | var | ) |
Definition at line 1175 of file presolve_context.cc.
| bool CanonicalizeObjective | ( | bool | simplify_domain = true | ) |
Definition at line 1603 of file presolve_context.cc.
| bool CanonicalizeOneObjectiveVariable | ( | int | var | ) |
Definition at line 1550 of file presolve_context.cc.
| void CanonicalizeVariable | ( | int | ref | ) |
Definition at line 787 of file presolve_context.cc.
| void ClearPrecedenceCache | ( | ) |
Definition at line 2045 of file presolve_context.cc.
| void ClearStats | ( | ) |
Definition at line 62 of file presolve_context.cc.
|
inline |
Definition at line 145 of file presolve_context.h.
| bool ConstraintIsInactive | ( | int | ct_index | ) | const |
Definition at line 483 of file presolve_context.cc.
| bool ConstraintIsOptional | ( | int | ct_ref | ) | const |
Definition at line 495 of file presolve_context.cc.
|
inline |
Definition at line 485 of file presolve_context.h.
|
inline |
Definition at line 481 of file presolve_context.h.
| bool ConstraintVariableGraphIsUpToDate | ( | ) | const |
Definition at line 589 of file presolve_context.cc.
| bool ConstraintVariableUsageIsConsistent | ( | ) |
Definition at line 608 of file presolve_context.cc.
| bool DomainContains | ( | const LinearExpressionProto & | expr, |
| int64_t | value | ||
| ) | const |
Definition at line 404 of file presolve_context.cc.
| bool DomainContains | ( | int | ref, |
| int64_t | value | ||
| ) | const |
Definition at line 397 of file presolve_context.cc.
| bool DomainIsEmpty | ( | int | ref | ) | const |
Definition at line 103 of file presolve_context.cc.
| Domain DomainOf | ( | int | ref | ) | const |
Definition at line 387 of file presolve_context.cc.
|
inline |
Definition at line 183 of file presolve_context.h.
| Domain DomainSuperSetOf | ( | const LinearExpressionProto & | expr | ) | const |
Definition at line 197 of file presolve_context.cc.
| int64_t EndMax | ( | int | ct_ref | ) | const |
Definition at line 300 of file presolve_context.cc.
| int64_t EndMin | ( | int | ct_ref | ) | const |
Definition at line 294 of file presolve_context.cc.
| bool ExploitExactlyOneInObjective | ( | absl::Span< const int > | exactly_one | ) |
Definition at line 1831 of file presolve_context.cc.
| bool ExpressionIsAffineBoolean | ( | const LinearExpressionProto & | expr | ) | const |
Definition at line 207 of file presolve_context.cc.
| bool ExpressionIsALiteral | ( | const LinearExpressionProto & | expr, |
| int * | literal = nullptr |
||
| ) | const |
Definition at line 224 of file presolve_context.cc.
| bool ExpressionIsSingleVariable | ( | const LinearExpressionProto & | expr | ) | const |
Definition at line 219 of file presolve_context.cc.
| int64_t FixedValue | ( | const LinearExpressionProto & | expr | ) | const |
Definition at line 188 of file presolve_context.cc.
| int64_t FixedValue | ( | int | ref | ) | const |
Definition at line 148 of file presolve_context.cc.
| bool GetAbsRelation | ( | int | target_ref, |
| int * | ref | ||
| ) |
Definition at line 1090 of file presolve_context.cc.
| AffineRelation::Relation GetAffineRelation | ( | int | ref | ) | const |
Definition at line 1140 of file presolve_context.cc.
| int GetFalseLiteral | ( | ) |
Definition at line 81 of file presolve_context.cc.
| int GetIntervalRepresentative | ( | int | index | ) |
Definition at line 2123 of file presolve_context.cc.
| int GetLiteralRepresentative | ( | int | ref | ) | const |
Definition at line 1109 of file presolve_context.cc.
| int GetOrCreateAffineValueEncoding | ( | const LinearExpressionProto & | expr, |
| int64_t | value | ||
| ) |
Definition at line 1477 of file presolve_context.cc.
| int GetOrCreateReifiedPrecedenceLiteral | ( | const LinearExpressionProto & | time_i, |
| const LinearExpressionProto & | time_j, | ||
| int | active_i, | ||
| int | active_j | ||
| ) |
Definition at line 1945 of file presolve_context.cc.
| int GetOrCreateVarValueEncoding | ( | int | ref, |
| int64_t | value | ||
| ) |
Definition at line 1405 of file presolve_context.cc.
| std::tuple< int, int64_t, int, int64_t, int64_t, int, int > GetReifiedPrecedenceKey | ( | const LinearExpressionProto & | time_i, |
| const LinearExpressionProto & | time_j, | ||
| int | active_i, | ||
| int | active_j | ||
| ) |
Definition at line 2026 of file presolve_context.cc.
| int GetTrueLiteral | ( | ) |
Definition at line 73 of file presolve_context.cc.
| int GetVariableRepresentative | ( | int | ref | ) | const |
| bool HasVarValueEncoding | ( | int | ref, |
| int64_t | value, | ||
| int * | literal = nullptr |
||
| ) |
Definition at line 1375 of file presolve_context.cc.
| void InitializeNewDomains | ( | ) |
Definition at line 1161 of file presolve_context.cc.
| bool InsertVarValueEncoding | ( | int | literal, |
| int | ref, | ||
| int64_t | value | ||
| ) |
Definition at line 1351 of file presolve_context.cc.
| ABSL_MUST_USE_RESULT bool IntersectDomainWith | ( | const LinearExpressionProto & | expr, |
| const Domain & | domain, | ||
| bool * | domain_modified = nullptr |
||
| ) |
Definition at line 451 of file presolve_context.cc.
| ABSL_MUST_USE_RESULT bool IntersectDomainWith | ( | int | ref, |
| const Domain & | domain, | ||
| bool * | domain_modified = nullptr |
||
| ) |
Definition at line 414 of file presolve_context.cc.
| std::string IntervalDebugString | ( | int | ct_ref | ) | const |
Definition at line 256 of file presolve_context.cc.
| bool IntervalIsConstant | ( | int | ct_ref | ) | const |
Definition at line 247 of file presolve_context.cc.
|
inline |
Definition at line 493 of file presolve_context.h.
| bool IsFixed | ( | const LinearExpressionProto & | expr | ) | const |
Definition at line 181 of file presolve_context.cc.
| bool IsFixed | ( | int | ref | ) | const |
Definition at line 107 of file presolve_context.cc.
| bool IsFullyEncoded | ( | const LinearExpressionProto & | expr | ) | const |
Definition at line 1399 of file presolve_context.cc.
| bool IsFullyEncoded | ( | int | ref | ) | const |
Definition at line 1391 of file presolve_context.cc.
| int LiteralForExpressionMax | ( | const LinearExpressionProto & | expr | ) | const |
Definition at line 213 of file presolve_context.cc.
| bool LiteralIsFalse | ( | int | lit | ) | const |
Definition at line 127 of file presolve_context.cc.
| bool LiteralIsTrue | ( | int | lit | ) | const |
Definition at line 118 of file presolve_context.cc.
|
inline |
Definition at line 545 of file presolve_context.h.
| void LogInfo | ( | ) |
Definition at line 2049 of file presolve_context.cc.
| void MarkVariableAsRemoved | ( | int | ref | ) |
Definition at line 353 of file presolve_context.cc.
| int64_t MaxOf | ( | const LinearExpressionProto & | expr | ) | const |
Definition at line 168 of file presolve_context.cc.
| int64_t MaxOf | ( | int | ref | ) | const |
Definition at line 142 of file presolve_context.cc.
| int64_t MinOf | ( | const LinearExpressionProto & | expr | ) | const |
Definition at line 155 of file presolve_context.cc.
| int64_t MinOf | ( | int | ref | ) | const |
Definition at line 136 of file presolve_context.cc.
|
inline |
Definition at line 517 of file presolve_context.h.
|
inline |
Definition at line 235 of file presolve_context.h.
| int NewBoolVar | ( | ) |
Definition at line 71 of file presolve_context.cc.
| int NewIntVar | ( | const Domain & | domain | ) |
Definition at line 64 of file presolve_context.cc.
|
inline |
Definition at line 518 of file presolve_context.h.
|
inline |
Definition at line 227 of file presolve_context.h.
|
inline |
Definition at line 314 of file presolve_context.h.
|
inline |
Definition at line 461 of file presolve_context.h.
|
inline |
Definition at line 457 of file presolve_context.h.
|
inline |
Definition at line 466 of file presolve_context.h.
|
inline |
Definition at line 458 of file presolve_context.h.
|
inline |
Definition at line 546 of file presolve_context.h.
| bool PropagateAffineRelation | ( | int | ref | ) |
Definition at line 715 of file presolve_context.cc.
| bool PropagateAffineRelation | ( | int | ref, |
| int | rep, | ||
| int64_t | coeff, | ||
| int64_t | offset | ||
| ) |
Definition at line 722 of file presolve_context.cc.
|
inline |
Definition at line 548 of file presolve_context.h.
| void ReadObjectiveFromProto | ( | ) |
Definition at line 1496 of file presolve_context.cc.
| bool RecomputeSingletonObjectiveDomain | ( | ) |
Definition at line 1693 of file presolve_context.cc.
| std::string RefDebugString | ( | int | ref | ) | const |
Definition at line 1149 of file presolve_context.cc.
|
inline |
Definition at line 508 of file presolve_context.h.
| void RemoveAllVariablesFromAffineRelationConstraint | ( | ) |
Definition at line 750 of file presolve_context.cc.
| void RemoveVariableFromAffineRelation | ( | int | var | ) |
Definition at line 759 of file presolve_context.cc.
| void RemoveVariableFromObjective | ( | int | ref | ) |
Definition at line 1710 of file presolve_context.cc.
| bool ScaleFloatingPointObjective | ( | ) |
Definition at line 798 of file presolve_context.cc.
| ABSL_MUST_USE_RESULT bool SetLiteralToFalse | ( | int | lit | ) |
Definition at line 473 of file presolve_context.cc.
| ABSL_MUST_USE_RESULT bool SetLiteralToTrue | ( | int | lit | ) |
Definition at line 479 of file presolve_context.cc.
| bool ShiftCostInExactlyOne | ( | absl::Span< const int > | exactly_one, |
| int64_t | shift | ||
| ) |
Definition at line 1853 of file presolve_context.cc.
| int64_t SizeMax | ( | int | ct_ref | ) | const |
Definition at line 312 of file presolve_context.cc.
| int64_t SizeMin | ( | int | ct_ref | ) | const |
Definition at line 306 of file presolve_context.cc.
| int64_t StartMax | ( | int | ct_ref | ) | const |
Definition at line 288 of file presolve_context.cc.
| int64_t StartMin | ( | int | ct_ref | ) | const |
Definition at line 282 of file presolve_context.cc.
| bool StoreAbsRelation | ( | int | target_ref, |
| int | ref | ||
| ) |
Definition at line 1075 of file presolve_context.cc.
| bool StoreAffineRelation | ( | int | ref_x, |
| int | ref_y, | ||
| int64_t | coeff, | ||
| int64_t | offset, | ||
| bool | debug_no_recursion = false |
||
| ) |
Definition at line 881 of file presolve_context.cc.
| bool StoreBooleanEqualityRelation | ( | int | ref_a, |
| int | ref_b | ||
| ) |
Definition at line 1052 of file presolve_context.cc.
| bool StoreLiteralImpliesVarEqValue | ( | int | literal, |
| int | var, | ||
| int64_t | value | ||
| ) |
Definition at line 1361 of file presolve_context.cc.
| bool StoreLiteralImpliesVarNEqValue | ( | int | literal, |
| int | var, | ||
| int64_t | value | ||
| ) |
Definition at line 1368 of file presolve_context.cc.
| bool SubstituteVariableInObjective | ( | int | var_in_equality, |
| int64_t | coeff_in_equality, | ||
| const ConstraintProto & | equality | ||
| ) |
Definition at line 1755 of file presolve_context.cc.
|
inline |
Definition at line 547 of file presolve_context.h.
| void UpdateConstraintVariableUsage | ( | int | c | ) |
Definition at line 553 of file presolve_context.cc.
| void UpdateNewConstraintsVariableUsage | ( | ) |
Definition at line 593 of file presolve_context.cc.
| void UpdateRuleStats | ( | const std::string & | name, |
| int | num_times = 1 |
||
| ) |
Definition at line 505 of file presolve_context.cc.
| bool VariableIsNotUsedAnymore | ( | int | ref | ) | const |
Definition at line 348 of file presolve_context.cc.
| bool VariableIsOnlyUsedInEncodingAndMaybeInObjective | ( | int | ref | ) | const |
Definition at line 378 of file presolve_context.cc.
| bool VariableIsUniqueAndRemovable | ( | int | ref | ) | const |
Definition at line 322 of file presolve_context.cc.
| bool VariableWasRemoved | ( | int | ref | ) | const |
Definition at line 360 of file presolve_context.cc.
| bool VariableWithCostIsUnique | ( | int | ref | ) | const |
Definition at line 328 of file presolve_context.cc.
| bool VariableWithCostIsUniqueAndRemovable | ( | int | ref | ) | const |
Definition at line 339 of file presolve_context.cc.
|
inline |
Definition at line 489 of file presolve_context.h.
| void WriteObjectiveToProto | ( | ) | const |
Definition at line 1912 of file presolve_context.cc.
| void WriteVariableDomainsToProto | ( | ) | const |
Definition at line 1939 of file presolve_context.cc.
| DomainDeductions deductions |
Definition at line 581 of file presolve_context.h.
| bool keep_all_feasible_solutions = false |
Definition at line 558 of file presolve_context.h.
| CpModelProto* mapping_model = nullptr |
Definition at line 551 of file presolve_context.h.
| SparseBitset<int> modified_domains |
Definition at line 574 of file presolve_context.h.
| int64_t num_presolve_operations = 0 |
Definition at line 565 of file presolve_context.h.
| std::vector<Domain> tmp_left_domains |
Definition at line 570 of file presolve_context.h.
| absl::flat_hash_set<int> tmp_literal_set |
Definition at line 571 of file presolve_context.h.
| std::vector<int> tmp_literals |
Definition at line 568 of file presolve_context.h.
| std::vector<Domain> tmp_term_domains |
Definition at line 569 of file presolve_context.h.
| SparseBitset<int> var_with_reduced_small_degree |
Definition at line 578 of file presolve_context.h.
| CpModelProto* working_model = nullptr |
Definition at line 550 of file presolve_context.h.