![]() |
OR-Tools
8.2
|
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 | LowerBound (AffineExpression expr) const |
IntegerValue | UpperBound (AffineExpression expr) const |
bool | IsFixed (AffineExpression expr) const |
IntegerLiteral | LowerBoundAsLiteral (IntegerVariable i) const |
IntegerLiteral | UpperBoundAsLiteral (IntegerVariable i) const |
bool | IntegerLiteralIsTrue (IntegerLiteral l) const |
bool | IntegerLiteralIsFalse (IntegerLiteral l) const |
IntegerValue | LevelZeroLowerBound (IntegerVariable var) const |
IntegerValue | LevelZeroUpperBound (IntegerVariable var) const |
bool | IsFixedAtLevelZero (IntegerVariable var) 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 | 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) |
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 | num_enqueues () const |
int64 | timestamp () const |
int64 | 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 |
IntegerVariable | NextVariableToBranchOnInPropagationLoop () const |
bool | CurrentBranchHadAnIncompletePropagation () |
IntegerVariable | FirstUnassignedVariable () const |
bool | HasPendingRootLevelDeduction () const |
void | SetPropagatorId (int id) |
int | PropagatorId () const |
bool | PropagatePreconditionsAreSatisfied (const Trail &trail) const |
bool | PropagationIsDone (const Trail &trail) 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 473 of file integer.cc.
IntegerVariable AddIntegerVariable | ( | const Domain & | domain | ) |
Definition at line 636 of file integer.cc.
IntegerVariable AddIntegerVariable | ( | IntegerValue | lower_bound, |
IntegerValue | upper_bound | ||
) |
Definition at line 603 of file integer.cc.
void AppendNewBounds | ( | std::vector< IntegerLiteral > * | output | ) | const |
Definition at line 1728 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 807 of file integer.cc.
bool ConditionalEnqueue | ( | Literal | lit, |
IntegerLiteral | i_lit, | ||
std::vector< Literal > * | literal_reason, | ||
std::vector< IntegerLiteral > * | integer_reason | ||
) |
Definition at line 996 of file integer.cc.
bool CurrentBranchHadAnIncompletePropagation | ( | ) |
Definition at line 1186 of file integer.cc.
bool Enqueue | ( | IntegerLiteral | i_lit, |
absl::Span< const Literal > | literal_reason, | ||
absl::Span< const IntegerLiteral > | integer_reason | ||
) |
Definition at line 989 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 1025 of file integer.cc.
bool Enqueue | ( | IntegerLiteral | i_lit, |
LazyReasonFunction | lazy_reason | ||
) |
Definition at line 1033 of file integer.cc.
void EnqueueLiteral | ( | Literal | literal, |
absl::Span< const Literal > | literal_reason, | ||
absl::Span< const IntegerLiteral > | integer_reason | ||
) |
Definition at line 1087 of file integer.cc.
int FindTrailIndexOfVarBefore | ( | IntegerVariable | var, |
int | threshold | ||
) | const |
Definition at line 716 of file integer.cc.
IntegerVariable FirstUnassignedVariable | ( | ) | const |
Definition at line 1190 of file integer.cc.
IntegerVariable GetOrCreateConstantIntegerVariable | ( | IntegerValue | value | ) |
Definition at line 695 of file integer.cc.
const Domain & InitialVariableDomain | ( | IntegerVariable | var | ) | const |
Definition at line 644 of file integer.cc.
bool InPropagationLoop | ( | ) | const |
Definition at line 1147 of file integer.cc.
|
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 1570 of file integer.cc.
IntegerVariable NextVariableToBranchOnInPropagationLoop | ( | ) | const |
Definition at line 1157 of file integer.cc.
int NumConstantVariables | ( | ) | const |
Definition at line 710 of file integer.cc.
|
inline |
|
finalvirtual |
Implements SatPropagator.
Definition at line 480 of file integer.cc.
|
inlineinherited |
Definition at line 517 of file sat_base.h.
|
inlineinherited |
Definition at line 500 of file sat_base.h.
|
inlineinherited |
Definition at line 453 of file sat_base.h.
Reimplemented from SatPropagator.
Definition at line 1708 of file integer.cc.
std::vector< Literal > ReasonFor | ( | IntegerLiteral | literal | ) | const |
Definition at line 1562 of file integer.cc.
|
inline |
|
inline |
void RelaxLinearReason | ( | IntegerValue | slack, |
absl::Span< const IntegerValue > | coeffs, | ||
std::vector< int > * | trail_indices | ||
) | const |
Definition at line 822 of file integer.cc.
void RelaxLinearReason | ( | IntegerValue | slack, |
absl::Span< const IntegerValue > | coeffs, | ||
std::vector< IntegerLiteral > * | reason | ||
) | const |
Definition at line 785 of file integer.cc.
void RemoveLevelZeroBounds | ( | std::vector< IntegerLiteral > * | reason | ) | const |
Definition at line 919 of file integer.cc.
|
inline |
|
inline |
void ReserveSpaceForNumVariables | ( | int | num_vars | ) |
Definition at line 592 of file integer.cc.
|
inlineinherited |
Definition at line 452 of file sat_base.h.
|
finalvirtual |
Reimplemented from SatPropagator.
Definition at line 543 of file integer.cc.
bool UpdateInitialDomain | ( | IntegerVariable | var, |
Domain | domain | ||
) |
Definition at line 648 of file integer.cc.
|
inline |
|
inline |
|
inline |
|
inline |
|
protectedinherited |
Definition at line 505 of file sat_base.h.
|
protectedinherited |
Definition at line 507 of file sat_base.h.
|
protectedinherited |
Definition at line 506 of file sat_base.h.