Makes the given literal true by assigning its underlying variable to either
true or false depending on the literal sign. This can only be called on an
unassigned variable.
Returns the literal of the given variable that is assigned to true.
That is, depending on the variable, it can be the positive literal or the
negative one. Only call this on an assigned variable.
[[["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."],[[["\u003cp\u003eThe \u003ccode\u003eVariablesAssignment\u003c/code\u003e class in C++ manages the assignment of variables within a solver, where each variable can be unassigned, true, or false.\u003c/p\u003e\n"],["\u003cp\u003eIt provides methods to assign and unassign variables, check their assignment status, and retrieve the literal assigned to true for a given variable.\u003c/p\u003e\n"],["\u003cp\u003eThe class allows resizing the number of variables and offers functionalities to determine if a literal or variable is assigned or has a specific truth value.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can access the literal corresponding to a variable's true assignment using \u003ccode\u003eGetTrueLiteralForAssignedVariable\u003c/code\u003e, ensuring the variable is assigned before calling this method.\u003c/p\u003e\n"]]],["The `VariablesAssignment` class manages variable assignments in a solver, where each variable can be unassigned, true, or false. Key actions include assigning a literal to true via `AssignFromTrueLiteral`, retrieving the true literal of an assigned variable with `GetTrueLiteralForAssignedVariable`, and unassigning a literal using `UnassignLiteral`. Methods also allow checking if a literal/variable is assigned (`LiteralIsAssigned`, `VariableIsAssigned`) or if a literal is true/false (`LiteralIsTrue`, `LiteralIsFalse`). Other functions include resizing the assignment space (`Resize`) and getting the number of variables (`NumberOfVariables`).\n"],null,["# VariablesAssignment\n\nC++ Reference: class VariablesAssignment\n========================================\n\n\nNote: This documentation is automatically generated.\nHolds the current variable assignment of the solver. Each variable can be unassigned or be assigned to true or false.\n\n| Method ||\n|-----------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [`AssignFromTrueLiteral`](https://github.com/google/or-tools/blob/v9.4/ortools/sat/sat_base.h#L136) | Return type: `void ` Arguments: `Literal literal` Makes the given literal true by assigning its underlying variable to either true or false depending on the literal sign. This can only be called on an unassigned variable. |\n| [`GetTrueLiteralForAssignedVariable`](https://github.com/google/or-tools/blob/v9.4/ortools/sat/sat_base.h#L168) | Return type: `Literal ` Arguments: `BooleanVariable var` Returns the literal of the given variable that is assigned to true. That is, depending on the variable, it can be the positive literal or the negative one. Only call this on an assigned variable. |\n| [`LiteralIsAssigned`](https://github.com/google/or-tools/blob/v9.4/ortools/sat/sat_base.h#L156) | Return type: `bool ` Arguments: `Literal literal` \u003cbr /\u003e |\n| [`LiteralIsFalse`](https://github.com/google/or-tools/blob/v9.4/ortools/sat/sat_base.h#L150) | Return type: `bool ` Arguments: `Literal literal` Literal getters. Note that both can be false, in which case the corresponding variable is not assigned. |\n| [`LiteralIsTrue`](https://github.com/google/or-tools/blob/v9.4/ortools/sat/sat_base.h#L153) | Return type: `bool ` Arguments: `Literal literal` \u003cbr /\u003e |\n| [`NumberOfVariables`](https://github.com/google/or-tools/blob/v9.4/ortools/sat/sat_base.h#L173) | Return type: `int ` \u003cbr /\u003e |\n| [`Resize`](https://github.com/google/or-tools/blob/v9.4/ortools/sat/sat_base.h#L129) | Return type: `void ` Arguments: `int num_variables` \u003cbr /\u003e |\n| [`UnassignLiteral`](https://github.com/google/or-tools/blob/v9.4/ortools/sat/sat_base.h#L143) | Return type: `void ` Arguments: `Literal literal` Unassign the variable corresponding to the given literal. This can only be called on an assigned variable. |\n| [`VariableIsAssigned`](https://github.com/google/or-tools/blob/v9.4/ortools/sat/sat_base.h#L161) | Return type: `bool ` Arguments: `BooleanVariable var` Returns true iff the given variable is assigned. |\n| [`VariablesAssignment`](https://github.com/google/or-tools/blob/v9.4/ortools/sat/sat_base.h#L127) | \u003cbr /\u003e |\n| [`VariablesAssignment`](https://github.com/google/or-tools/blob/v9.4/ortools/sat/sat_base.h#L128) | Return type: `explicit ` Arguments: `int num_variables` \u003cbr /\u003e |"]]