Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
|
#include <linear_model.h>
Public Member Functions | |
LinearModel (const CpModelProto &model_proto) | |
const CpModelProto & | model_proto () const |
const std::vector< bool > & | ignored_constraints () const |
Mask on the constraints of the model passed to the ctor. | |
const std::vector< ConstraintProto > & | additional_constraints () const |
Additional constraints created during the initialization. | |
int | num_ignored_constraints () const |
int | num_exactly_ones () const |
int | num_full_encodings () const |
int | num_element_encodings () const |
This class is meant to be a view on the full CpModelProto, with hidden and additional constraints. Currently, this class is meant to be used by the feasibility jump subsolver. It could also contains the linear relaxation at level 1 or 2 of the model and could be computed once for all workers of a given linearization level.
Definition at line 29 of file linear_model.h.
|
explicit |
Loop over all constraints and fill var_to_equalities.
Sort literals to get a canonical constraint.
ct is a linear constraint with one term and one enforcement literal.
Detect enforcement_literal => (var == value or var != value).
Detect Literal <=> X == value and rebuild full encodings.
We sort to have a canonical representation with increasing values and sorted literals.
Fill exactly one.
Fill linear encoding.
We shift the var = sum(lit * value) by the min value.
Add exactly_one constraint if new.
Definition at line 82 of file linear_model.cc.
|
inline |
Additional constraints created during the initialization.
Definition at line 41 of file linear_model.h.
|
inline |
Mask on the constraints of the model passed to the ctor.
Definition at line 36 of file linear_model.h.
|
inline |
Definition at line 33 of file linear_model.h.
|
inline |
Definition at line 48 of file linear_model.h.
|
inline |
Definition at line 46 of file linear_model.h.
|
inline |
Definition at line 47 of file linear_model.h.
|
inline |
Definition at line 45 of file linear_model.h.