Stay organized with collections
Save and categorize content based on your preferences.
C++ Reference: class BooleanVar
Note: This documentation is automatically generated.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-08-06 UTC.
[[["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\u003e\u003ccode\u003eBooleanVar\u003c/code\u003e is a class in C++ representing a boolean decision variable in constraint programming.\u003c/p\u003e\n"],["\u003cp\u003eIt provides methods for accessing and modifying the variable's domain, which consists of the values 0 and 1 (false and true).\u003c/p\u003e\n"],["\u003cp\u003eYou can use methods like \u003ccode\u003eMin\u003c/code\u003e, \u003ccode\u003eMax\u003c/code\u003e, \u003ccode\u003eBound\u003c/code\u003e, \u003ccode\u003eValue\u003c/code\u003e to check the variable's current state and possible values.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eBooleanVar\u003c/code\u003e offers functionalities to constrain the variable's values and interact with the solver through methods like \u003ccode\u003eRemoveValue\u003c/code\u003e, \u003ccode\u003eSetRange\u003c/code\u003e, \u003ccode\u003eWhenBound\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThis class inherits from \u003ccode\u003eIntVar\u003c/code\u003e and is part of the Google OR-Tools constraint solver library.\u003c/p\u003e\n"]]],["The `BooleanVar` class in C++ provides methods for managing boolean variables within a constraint solver. Key actions include: setting and getting the minimum/maximum values (`SetMin`, `SetMax`, `Min`, `Max`), setting ranges (`SetRange`), and checking if a value is contained (`Contains`). It allows removing values or intervals (`RemoveValue`, `RemoveInterval`), and checking the bounds or values of a variable (`Bound`, `Value`). Methods for checking if the variables is different, equal, greater or less are also available. Iterators are also available.\n"],null,["# BooleanVar\n\nC++ Reference: class BooleanVar\n===============================\n\n\nNote: This documentation is automatically generated.\n\n| Method ||\n|---------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------|\n| [`BaseName`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/constraint_solveri.h#L1993) | Return type: `std::string ` \u003cbr /\u003e |\n| [`BooleanVar`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/constraint_solveri.h#L1960) | Return type: `explicit ` Arguments: `Solver* const s, const std::string& name = \"\"` \u003cbr /\u003e |\n| [`~BooleanVar`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/constraint_solveri.h#L1963) | \u003cbr /\u003e |\n| [`Bound`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/constraint_solveri.h#L1970) | Return type: `bool ` \u003cbr /\u003e |\n| [`Contains`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/constraint_solveri.h#L1981) | Return type: `bool ` Arguments: `int64_t v` \u003cbr /\u003e |\n| [`DebugString`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/constraint_solveri.h#L1984) | Return type: `std::string ` \u003cbr /\u003e |\n| [`IsDifferent`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/constraint_solveri.h#L1988) | Return type: `IntVar* ` Arguments: `int64_t constant` \u003cbr /\u003e |\n| [`IsEqual`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/constraint_solveri.h#L1987) | Return type: `IntVar* ` Arguments: `int64_t constant` \u003cbr /\u003e |\n| [`IsGreaterOrEqual`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/constraint_solveri.h#L1989) | Return type: `IntVar* ` Arguments: `int64_t constant` \u003cbr /\u003e |\n| [`IsLessOrEqual`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/constraint_solveri.h#L1990) | Return type: `IntVar* ` Arguments: `int64_t constant` \u003cbr /\u003e |\n| [`MakeDomainIterator`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/constraint_solveri.h#L1983) | Return type: `IntVarIterator* ` Arguments: `bool reversible` \u003cbr /\u003e |\n| [`MakeHoleIterator`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/constraint_solveri.h#L1982) | Return type: `IntVarIterator* ` Arguments: `bool reversible` \u003cbr /\u003e |\n| [`Max`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/constraint_solveri.h#L1967) | Return type: `int64_t ` \u003cbr /\u003e |\n| [`Min`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/constraint_solveri.h#L1965) | Return type: `int64_t ` \u003cbr /\u003e |\n| [`RawValue`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/constraint_solveri.h#L1995) | Return type: `int ` \u003cbr /\u003e |\n| [`RemoveInterval`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/constraint_solveri.h#L1976) | Return type: `void ` Arguments: `int64_t l, int64_t u` \u003cbr /\u003e |\n| [`RemoveValue`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/constraint_solveri.h#L1975) | Return type: `void ` Arguments: `int64_t v` \u003cbr /\u003e |\n| [`RestoreValue`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/constraint_solveri.h#L1992) | Return type: `virtual void ` \u003cbr /\u003e |\n| [`SetMax`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/constraint_solveri.h#L1968) | Return type: `void ` Arguments: `int64_t m` \u003cbr /\u003e |\n| [`SetMin`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/constraint_solveri.h#L1966) | Return type: `void ` Arguments: `int64_t m` \u003cbr /\u003e |\n| [`SetRange`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/constraint_solveri.h#L1969) | Return type: `void ` Arguments: `int64_t mi, int64_t ma` \u003cbr /\u003e |\n| [`Size`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/constraint_solveri.h#L1980) | Return type: `uint64_t ` \u003cbr /\u003e |\n| [`Value`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/constraint_solveri.h#L1971) | Return type: `int64_t ` \u003cbr /\u003e |\n| [`VarType`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/constraint_solveri.h#L1985) | Return type: `int ` \u003cbr /\u003e |\n| [`WhenBound`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/constraint_solveri.h#L1977) | Return type: `void ` Arguments: `Demon* d` \u003cbr /\u003e |\n| [`WhenDomain`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/constraint_solveri.h#L1979) | Return type: `void ` Arguments: `Demon* d` \u003cbr /\u003e |\n| [`WhenRange`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/constraint_solveri.h#L1978) | Return type: `void ` Arguments: `Demon* d` \u003cbr /\u003e |"]]