![]() |
OR-Tools
9.6
|
Public Types | |
| using | LazyReasonFunction = std::function< void(IntegerLiteral literal_to_explain, int trail_index_of_literal, std::vector< Literal > *literals, std::vector< int > *dependencies)> |
Public Member Functions | |
| IntegerTrail (Model *model) | |
| ~IntegerTrail () final | |
| bool | Propagate (Trail *trail) final |
| void | Untrail (const Trail &trail, int literal_trail_index) final |
| absl::Span< const Literal > | Reason (const Trail &trail, int trail_index) const final |
| IntegerVariable | NumIntegerVariables () const |
| void | ReserveSpaceForNumVariables (int num_vars) |
| IntegerVariable | AddIntegerVariable (IntegerValue lower_bound, IntegerValue upper_bound) |
| IntegerVariable | AddIntegerVariable (const Domain &domain) |
| const Domain & | InitialVariableDomain (IntegerVariable var) const |
| bool | UpdateInitialDomain (IntegerVariable var, Domain domain) |
| IntegerVariable | GetOrCreateConstantIntegerVariable (IntegerValue value) |
| int | NumConstantVariables () const |
| IntegerVariable | AddIntegerVariable () |
| bool | IsOptional (IntegerVariable i) const |
| bool | IsCurrentlyIgnored (IntegerVariable i) const |
| Literal | IsIgnoredLiteral (IntegerVariable i) const |
| LiteralIndex | OptionalLiteralIndex (IntegerVariable i) const |
| void | MarkIntegerVariableAsOptional (IntegerVariable i, Literal is_considered) |
| IntegerValue | LowerBound (IntegerVariable i) const |
| IntegerValue | UpperBound (IntegerVariable i) const |
| bool | IsFixed (IntegerVariable i) const |
| IntegerValue | FixedValue (IntegerVariable i) const |
| IntegerValue | LowerBound (AffineExpression expr) const |
| IntegerValue | UpperBound (AffineExpression expr) const |
| bool | IsFixed (AffineExpression expr) const |
| IntegerValue | FixedValue (AffineExpression expr) const |
| IntegerLiteral | LowerBoundAsLiteral (IntegerVariable i) const |
| IntegerLiteral | UpperBoundAsLiteral (IntegerVariable i) const |
| IntegerLiteral | LowerBoundAsLiteral (AffineExpression expr) const |
| IntegerLiteral | UpperBoundAsLiteral (AffineExpression expr) const |
| bool | IntegerLiteralIsTrue (IntegerLiteral l) const |
| bool | IntegerLiteralIsFalse (IntegerLiteral l) const |
| IntegerValue | LevelZeroLowerBound (IntegerVariable var) const |
| IntegerValue | LevelZeroUpperBound (IntegerVariable var) const |
| IntegerValue | LevelZeroLowerBound (AffineExpression exp) const |
| IntegerValue | LevelZeroUpperBound (AffineExpression exp) const |
| bool | IsFixedAtLevelZero (IntegerVariable var) const |
| bool | IsFixedAtLevelZero (AffineExpression expr) const |
| IntegerValue | ConditionalLowerBound (Literal l, IntegerVariable i) const |
| IntegerValue | ConditionalLowerBound (Literal l, AffineExpression expr) const |
| void | RelaxLinearReason (IntegerValue slack, absl::Span< const IntegerValue > coeffs, std::vector< IntegerLiteral > *reason) const |
| void | AppendRelaxedLinearReason (IntegerValue slack, absl::Span< const IntegerValue > coeffs, absl::Span< const IntegerVariable > vars, std::vector< IntegerLiteral > *reason) const |
| void | RelaxLinearReason (IntegerValue slack, absl::Span< const IntegerValue > coeffs, std::vector< int > *trail_indices) const |
| void | RemoveLevelZeroBounds (std::vector< IntegerLiteral > *reason) const |
| ABSL_MUST_USE_RESULT bool | Enqueue (IntegerLiteral i_lit, absl::Span< const Literal > literal_reason, absl::Span< const IntegerLiteral > integer_reason) |
| ABSL_MUST_USE_RESULT bool | SafeEnqueue (IntegerLiteral i_lit, absl::Span< const IntegerLiteral > integer_reason) |
| ABSL_MUST_USE_RESULT bool | ConditionalEnqueue (Literal lit, IntegerLiteral i_lit, std::vector< Literal > *literal_reason, std::vector< IntegerLiteral > *integer_reason) |
| ABSL_MUST_USE_RESULT bool | Enqueue (IntegerLiteral i_lit, absl::Span< const Literal > literal_reason, absl::Span< const IntegerLiteral > integer_reason, int trail_index_with_same_reason) |
| ABSL_MUST_USE_RESULT bool | Enqueue (IntegerLiteral i_lit, LazyReasonFunction lazy_reason) |
| ABSL_MUST_USE_RESULT bool | RootLevelEnqueue (IntegerLiteral i_lit) |
| void | EnqueueLiteral (Literal literal, absl::Span< const Literal > literal_reason, absl::Span< const IntegerLiteral > integer_reason) |
| std::vector< Literal > | ReasonFor (IntegerLiteral literal) const |
| void | MergeReasonInto (absl::Span< const IntegerLiteral > literals, std::vector< Literal > *output) const |
| int64_t | num_enqueues () const |
| int64_t | timestamp () const |
| int64_t | num_level_zero_enqueues () const |
| void | RegisterWatcher (SparseBitset< IntegerVariable > *p) |
| bool | ReportConflict (absl::Span< const Literal > literal_reason, absl::Span< const IntegerLiteral > integer_reason) |
| bool | ReportConflict (absl::Span< const IntegerLiteral > integer_reason) |
| bool | VariableLowerBoundIsFromLevelZero (IntegerVariable var) const |
| void | RegisterReversibleClass (ReversibleInterface *rev) |
| int | Index () const |
| void | AppendNewBounds (std::vector< IntegerLiteral > *output) const |
| int | FindTrailIndexOfVarBefore (IntegerVariable var, int threshold) const |
| bool | InPropagationLoop () const |
| void | NotifyThatPropagationWasAborted () |
| IntegerVariable | NextVariableToBranchOnInPropagationLoop () const |
| bool | CurrentBranchHadAnIncompletePropagation () |
| IntegerVariable | FirstUnassignedVariable () const |
| bool | HasPendingRootLevelDeduction () const |
| void | RegisterDebugChecker (std::function< bool(absl::Span< const Literal > clause, absl::Span< const IntegerLiteral > integers)> checker) |
| void | SetPropagatorId (int id) |
| int | PropagatorId () const |
| bool | PropagatePreconditionsAreSatisfied (const Trail &trail) const |
| bool | PropagationIsDone (const Trail &trail) const |
| virtual bool | IsEmpty () const |
Protected Attributes | |
| const std::string | name_ |
| int | propagator_id_ |
| int | propagation_trail_index_ |
| using LazyReasonFunction = std::function<void( IntegerLiteral literal_to_explain, int trail_index_of_literal, std::vector<Literal>* literals, std::vector<int>* dependencies)> |
|
inlineexplicit |
|
final |
Definition at line 675 of file integer.cc.
| IntegerVariable AddIntegerVariable | ( | const Domain & | domain | ) |
Definition at line 844 of file integer.cc.
| IntegerVariable AddIntegerVariable | ( | IntegerValue | lower_bound, |
| IntegerValue | upper_bound | ||
| ) |
Definition at line 811 of file integer.cc.
| void AppendNewBounds | ( | std::vector< IntegerLiteral > * | output | ) | const |
Definition at line 2049 of file integer.cc.
| void AppendRelaxedLinearReason | ( | IntegerValue | slack, |
| absl::Span< const IntegerValue > | coeffs, | ||
| absl::Span< const IntegerVariable > | vars, | ||
| std::vector< IntegerLiteral > * | reason | ||
| ) | const |
Definition at line 1006 of file integer.cc.
| bool ConditionalEnqueue | ( | Literal | lit, |
| IntegerLiteral | i_lit, | ||
| std::vector< Literal > * | literal_reason, | ||
| std::vector< IntegerLiteral > * | integer_reason | ||
| ) |
Definition at line 1235 of file integer.cc.
|
inline |
|
inline |
| bool CurrentBranchHadAnIncompletePropagation | ( | ) |
Definition at line 1494 of file integer.cc.
| bool Enqueue | ( | IntegerLiteral | i_lit, |
| absl::Span< const Literal > | literal_reason, | ||
| absl::Span< const IntegerLiteral > | integer_reason | ||
| ) |
Definition at line 1228 of file integer.cc.
| bool Enqueue | ( | IntegerLiteral | i_lit, |
| absl::Span< const Literal > | literal_reason, | ||
| absl::Span< const IntegerLiteral > | integer_reason, | ||
| int | trail_index_with_same_reason | ||
| ) |
Definition at line 1279 of file integer.cc.
| bool Enqueue | ( | IntegerLiteral | i_lit, |
| LazyReasonFunction | lazy_reason | ||
| ) |
Definition at line 1287 of file integer.cc.
| void EnqueueLiteral | ( | Literal | literal, |
| absl::Span< const Literal > | literal_reason, | ||
| absl::Span< const IntegerLiteral > | integer_reason | ||
| ) |
Definition at line 1387 of file integer.cc.
| int FindTrailIndexOfVarBefore | ( | IntegerVariable | var, |
| int | threshold | ||
| ) | const |
Definition at line 914 of file integer.cc.
| IntegerVariable FirstUnassignedVariable | ( | ) | const |
Definition at line 1498 of file integer.cc.
|
inline |
|
inline |
| IntegerVariable GetOrCreateConstantIntegerVariable | ( | IntegerValue | value | ) |
Definition at line 893 of file integer.cc.
| const Domain & InitialVariableDomain | ( | IntegerVariable | var | ) | const |
Definition at line 852 of file integer.cc.
| bool InPropagationLoop | ( | ) | const |
Definition at line 1447 of file integer.cc.
|
inline |
|
inline |
|
inlinevirtualinherited |
Reimplemented in PbConstraints, and BinaryImplicationGraph.
Definition at line 538 of file sat_base.h.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
| void MergeReasonInto | ( | absl::Span< const IntegerLiteral > | literals, |
| std::vector< Literal > * | output | ||
| ) | const |
Definition at line 1879 of file integer.cc.
| IntegerVariable NextVariableToBranchOnInPropagationLoop | ( | ) | const |
Definition at line 1465 of file integer.cc.
| void NotifyThatPropagationWasAborted | ( | ) |
Definition at line 1457 of file integer.cc.
| int NumConstantVariables | ( | ) | const |
Definition at line 908 of file integer.cc.
|
inline |
|
finalvirtual |
Implements SatPropagator.
Definition at line 682 of file integer.cc.
|
inlineinherited |
Definition at line 553 of file sat_base.h.
|
inlineinherited |
Definition at line 530 of file sat_base.h.
|
inlineinherited |
Definition at line 483 of file sat_base.h.
Reimplemented from SatPropagator.
Definition at line 2029 of file integer.cc.
| std::vector< Literal > ReasonFor | ( | IntegerLiteral | literal | ) | const |
Definition at line 1873 of file integer.cc.
|
inline |
|
inline |
|
inline |
| void RelaxLinearReason | ( | IntegerValue | slack, |
| absl::Span< const IntegerValue > | coeffs, | ||
| std::vector< int > * | trail_indices | ||
| ) | const |
Definition at line 1021 of file integer.cc.
| void RelaxLinearReason | ( | IntegerValue | slack, |
| absl::Span< const IntegerValue > | coeffs, | ||
| std::vector< IntegerLiteral > * | reason | ||
| ) | const |
Definition at line 984 of file integer.cc.
| void RemoveLevelZeroBounds | ( | std::vector< IntegerLiteral > * | reason | ) | const |
Definition at line 1118 of file integer.cc.
|
inline |
|
inline |
| void ReserveSpaceForNumVariables | ( | int | num_vars | ) |
Definition at line 797 of file integer.cc.
| bool RootLevelEnqueue | ( | IntegerLiteral | i_lit | ) |
Definition at line 1188 of file integer.cc.
| bool SafeEnqueue | ( | IntegerLiteral | i_lit, |
| absl::Span< const IntegerLiteral > | integer_reason | ||
| ) |
Definition at line 1211 of file integer.cc.
|
inlineinherited |
Definition at line 482 of file sat_base.h.
|
finalvirtual |
Reimplemented from SatPropagator.
Definition at line 748 of file integer.cc.
| bool UpdateInitialDomain | ( | IntegerVariable | var, |
| Domain | domain | ||
| ) |
Definition at line 862 of file integer.cc.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
protectedinherited |
Definition at line 541 of file sat_base.h.
|
protectedinherited |
Definition at line 543 of file sat_base.h.
|
protectedinherited |
Definition at line 542 of file sat_base.h.