TODO(user): We could "easily" create an intermediate variable for more
complex linear expression. We could also identify duplicate expressions to
not create two identical integer variable.
Depending on the option, we will load constraints in stages. This is used
to detect constraints that are already loaded. For instance the interval
constraints and the linear constraint of size 1 (encodings) are usually
loaded first.
Returns true if the given CpModelProto variable reference refers to a
Boolean variable. Such variable will always have an associated Literal(),
but not always an associated Integer().
Returns true if the given constraint is a "half-encoding" constraint. That
is, if it is of the form (b => size 1 linear) but there is no (<=) side in
the model. Such constraint are detected while we extract integer encoding
and are cached here so that we can deal properly with them during the
linear relaxation.
Returns a heuristic set of values that could be created for the given
variable when the constraints will be loaded.
Note that the pointer is not stable across calls.
It returns nullptr if the set is empty.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-08-06 UTC."],[[["The `CpModelMapping` class manages the relationship between `CpModel` proto indices and the corresponding `sat::model` indices."],["It stores information necessary for loading a `CpModel` proto and provides methods to access and convert between different variable types and representations."],["The class offers functionalities to retrieve variables (Boolean, Integer, Interval), expressions (Affine, Linear), and literals, as well as to check variable types and constraint properties."],["It includes methods to identify half-encoding constraints and potentially encoded values for variables."],["Several utility functions are available, such as `NumBooleanVariables`, `NumIntegerVariables`, and `NumProtoVariables`, primarily for logging and informational purposes."]]],["The `CpModelMapping` class manages the correspondence between indices in a `CpModel` proto and the internal `sat::model`. It handles the loading of `CpModel` proto data, and provides methods to interact with variables and constraints. Key actions include mapping variables (Boolean, integer, interval) to their proto counterparts, creating affine and linear expressions, and identifying loaded or \"half-encoding\" constraints. It also checks variable types (Boolean, integer) and returns counts of loaded Boolean and integer variables.\n"]]