![]() |
Google OR-Tools v9.12
a fast and portable software suite for combinatorial optimization
|
#include <precedences.h>
Public Member Functions | |
int | size () const |
const Relation & | relation (int index) const |
absl::Span< const int > | relation_indices (LiteralIndex lit) const |
void | Add (Literal lit, LinearTerm a, LinearTerm b, IntegerValue lhs, IntegerValue rhs) |
Adds a relation lit => a + b \in [lhs, rhs]. | |
void | Build () |
bool | PropagateLocalBounds (const IntegerTrail &integer_trail, Literal lit, const absl::flat_hash_map< IntegerVariable, IntegerValue > &input, absl::flat_hash_map< IntegerVariable, IntegerValue > *output) const |
A repository of all the enforced linear constraints of size 1 or 2.
Definition at line 494 of file precedences.h.
void operations_research::sat::BinaryRelationRepository::Add | ( | Literal | lit, |
LinearTerm | a, | ||
LinearTerm | b, | ||
IntegerValue | lhs, | ||
IntegerValue | rhs ) |
Adds a relation lit => a + b \in [lhs, rhs].
We shall only consider positive variable here.
Definition at line 1108 of file precedences.cc.
void operations_research::sat::BinaryRelationRepository::Build | ( | ) |
Builds the literal to relations mapping. This should be called once all the relations have been added.
Definition at line 1130 of file precedences.cc.
bool operations_research::sat::BinaryRelationRepository::PropagateLocalBounds | ( | const IntegerTrail & | integer_trail, |
Literal | lit, | ||
const absl::flat_hash_map< IntegerVariable, IntegerValue > & | input, | ||
absl::flat_hash_map< IntegerVariable, IntegerValue > * | output ) const |
Assuming level-zero bounds + any (var >= value) in the input map, fills "output" with a "propagated" set of bounds assuming lit is true (by using the relations enforced by lit). Note that we will only fill bounds > level-zero ones in output.
Returns false if the new bounds are infeasible at level zero.
lb(b.y) <= b.y <= ub(b.y) and lhs <= a.x + b.y <= rhs imply ceil((lhs - ub(b.y)) / a) <= x <= floor((rhs - lb(b.y)) / a)
Check feasibility.
Definition at line 1391 of file precedences.cc.
|
inline |
Definition at line 497 of file precedences.h.
|
inline |
Definition at line 499 of file precedences.h.
|
inline |
Definition at line 496 of file precedences.h.