![]() |
Google OR-Tools v9.14
a fast and portable software suite for combinatorial optimization
|
To simplify cut generation code, we use a more complex data structure than just a LinearConstraint to represent a cut with shifted/complemented variable and implied bound substitution.
#include <cuts.h>
Public Member Functions | |
| bool | IsBoolean () const |
| bool | IsSimple () const |
| bool | HasRelevantLpValue () const |
| bool | IsFractional () const |
| double | LpDistToMaxValue () const |
| std::string | DebugString () const |
| void | Complement (absl::int128 *rhs) |
| void | ReplaceExpressionByLiteral (IntegerVariable var) |
| IntegerVariable | GetUnderlyingLiteralOrNone () const |
Public Attributes | |
| double | lp_value = 0.0 |
| IntegerValue | coeff = IntegerValue(0) |
| IntegerValue | bound_diff = IntegerValue(0) |
| IntegerValue | expr_offset = IntegerValue(0) |
| std::array< IntegerVariable, 2 > | expr_vars |
| std::array< IntegerValue, 2 > | expr_coeffs |
| int | cached_implied_lb = -1 |
| Refer to cached_data_ in ImpliedBoundsProcessor. | |
| int | cached_implied_ub = -1 |
| void operations_research::sat::CutTerm::Complement | ( | absl::int128 * | rhs | ) |
Do the subtitution X -> (1 - X') and update the rhs.
Our precondition on the sum of variable domains fitting an int64_t should ensure that this can never overflow.
We replace coeff * X by coeff * (X - bound_diff + bound_diff) which gives -coeff * complement(X) + coeff * bound_diff;
We keep the same expression variable.
Swap the implied bound info.
| std::string operations_research::sat::CutTerm::DebugString | ( | ) | const |
| IntegerVariable operations_research::sat::CutTerm::GetUnderlyingLiteralOrNone | ( | ) | const |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
| void operations_research::sat::CutTerm::ReplaceExpressionByLiteral | ( | IntegerVariable | var | ) |
| IntegerValue operations_research::sat::CutTerm::bound_diff = IntegerValue(0) |
| int operations_research::sat::CutTerm::cached_implied_lb = -1 |
Refer to cached_data_ in ImpliedBoundsProcessor.
| int operations_research::sat::CutTerm::cached_implied_ub = -1 |
| IntegerValue operations_research::sat::CutTerm::coeff = IntegerValue(0) |
| std::array<IntegerValue, 2> operations_research::sat::CutTerm::expr_coeffs |
| IntegerValue operations_research::sat::CutTerm::expr_offset = IntegerValue(0) |
X = the given LinearExpression. We only support size 1 or 2 here which allow to inline the memory. When a coefficient is zero, we don't care about the variable.
| std::array<IntegerVariable, 2> operations_research::sat::CutTerm::expr_vars |
| double operations_research::sat::CutTerm::lp_value = 0.0 |