![]() |
Google OR-Tools v9.14
a fast and portable software suite for combinatorial optimization
|
#include <precedences.h>
Definition at line 591 of file precedences.h.
|
explicit |
Linear scan.
Definition at line 1534 of file precedences.cc.
operations_research::sat::BinaryRelationsMaps::~BinaryRelationsMaps | ( | ) |
Definition at line 1568 of file precedences.cc.
bool operations_research::sat::BinaryRelationsMaps::AddAffineUpperBound | ( | LinearExpression2 | expr, |
AffineExpression | affine_ub ) |
If the given upper bound evaluate better than the current one we have, this will replace it and returns true, otherwise it returns false.
Not better than trivial upper bound.
Not better than the root level upper bound.
We have an affine bound for this expr in the map. Can be exactly the same, a better one or a worse one.
The affine bound is already in the map.
We have gcd * canonical_expr <= affine_ub, so we do need to store a "divisor".
Definition at line 1698 of file precedences.cc.
void operations_research::sat::BinaryRelationsMaps::AddReasonForUpperBoundLowerThan | ( | LinearExpression2 | expr, |
IntegerValue | ub, | ||
std::vector< Literal > * | literal_reason, | ||
std::vector< IntegerLiteral > * | integer_reason ) const |
Starts by simple bounds.
Add explanation if it is a trivial bound.
None of the bound above are enough, try the affine one. Note that gcd * expr <= ub, is the same as asking why expr <= FloorRatio(ub, gcd).
We want the reason for "expr <= ub", that is the reason for
knowing that canonical_expr <= affine_ub / divisor.
Definition at line 1761 of file precedences.cc.
void operations_research::sat::BinaryRelationsMaps::AddReifiedPrecedenceIfNonTrivial | ( | Literal | l, |
AffineExpression | a, | ||
AffineExpression | b ) |
Register the fact that l <=> ( a <= b ). These are considered equivalence relation.
Definition at line 1669 of file precedences.cc.
void operations_research::sat::BinaryRelationsMaps::AddRelationBounds | ( | LinearExpression2 | expr, |
IntegerValue | lb, | ||
IntegerValue | ub ) |
This mainly wraps BestBinaryRelationBounds, but in addition it checks the current LevelZero variable bounds to detect trivially true or false relation.
Definition at line 1614 of file precedences.cc.
std::vector< LinearExpression2 > operations_research::sat::BinaryRelationsMaps::GetAllExpressionsWithAffineBounds | ( | ) | const |
Warning, the order will not be deterministic.
Definition at line 1801 of file precedences.cc.
RelationStatus operations_research::sat::BinaryRelationsMaps::GetLevelZeroPrecedenceStatus | ( | AffineExpression | a, |
AffineExpression | b ) const |
Return the status of a <= b;.
Definition at line 1663 of file precedences.cc.
RelationStatus operations_research::sat::BinaryRelationsMaps::GetLevelZeroStatus | ( | LinearExpression2 | expr, |
IntegerValue | lb, | ||
IntegerValue | ub ) const |
Returns directly if the status can be derived from the implied bounds.
Relax as best_root_level_bounds_.GetStatus() might have older bounds.
Definition at line 1631 of file precedences.cc.
LiteralIndex operations_research::sat::BinaryRelationsMaps::GetReifiedPrecedence | ( | AffineExpression | a, |
AffineExpression | b ) |
Returns kNoLiteralIndex if we don't have a literal <=> ( a <= b ), or returns that literal if we have one. Note that we will return the true/false literal if the status is known at level zero.
Definition at line 1682 of file precedences.cc.
|
inline |
Definition at line 637 of file precedences.h.
IntegerValue operations_research::sat::BinaryRelationsMaps::UpperBound | ( | LinearExpression2 | expr | ) | const |
Returns the best known upper-bound of the given LinearExpression2 at the current decision level. If its explanation is needed, it can be queried with the second function.
Definition at line 1740 of file precedences.cc.
|
inline |
Definition at line 639 of file precedences.h.