![]() |
Google OR-Tools v9.12
a fast and portable software suite for combinatorial optimization
|
Stores temporaries used to build or manipulate a CutData. More...
#include <cuts.h>
Public Member Functions | |
bool | ConvertToLinearConstraint (const CutData &cut, LinearConstraint *output) |
Returns false if we encounter an integer overflow. | |
int | AddOrMergeBooleanTerms (absl::Span< CutTerm > terms, IntegerValue t, CutData *cut) |
int operations_research::sat::CutDataBuilder::AddOrMergeBooleanTerms | ( | absl::Span< CutTerm > | new_terms, |
IntegerValue | t, | ||
CutData * | cut ) |
These function allow to merges entries corresponding to the same variable and complementation. That is (X - lb) and (ub - X) are NOT merged and kept as separate terms. Note that we currently only merge Booleans since this is the only case we need.
Return num_merges.
We only deal with coeff * Bool or coeff * (1 - Bool)
Fill the maps.
Loop over the cut now. Note that we loop with indices as we might add new terms in the middle of the loop.
We found a match, try to merge the map entry into the cut.
Finally add the terms we couldn't merge.
bool operations_research::sat::CutDataBuilder::ConvertToLinearConstraint | ( | const CutData & | cut, |
LinearConstraint * | output ) |