Stay organized with collections
Save and categorize content based on your preferences.
C++ Reference: class IntExpr
Note: This documentation is automatically generated.
The class IntExpr is the base of all integer expressions in
constraint programming.
It contains the basic protocol for an expression:
- setting and modifying its bound
- querying if it is bound
- listening to events modifying its bounds
- casting it into a variable (instance of IntVar)
Creates a variable from the expression and set the name of the
resulting var. If the expression is already a variable, then it
will set the name of the expression, possibly overwriting it.
This is just a shortcut to Var() followed by set_name().
[[["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."],[[["IntExpr serves as the foundation for all integer expressions within constraint programming in or-tools."],["It provides essential functionalities like setting and adjusting expression bounds, checking if an expression is bound, and reacting to bound modifications."],["IntExpr allows casting to an IntVar (integer variable) and offers methods for retrieving minimum and maximum values."],["Developers can use IntExpr to monitor changes in expression bounds through demons and manage the expression's range."]]],["The `IntExpr` class, fundamental to integer expressions in constraint programming, manages expression behavior. Key actions include setting/modifying bounds via `SetMin`, `SetMax`, `SetRange`, and `SetValue`. It also checks for bound status using `Bound` and variable status via `IsVar`. Methods like `Min`, `Max` and `Range` retrieve bounds. It facilitates casting to variables (`Var`), adding names to variables (`VarWithName`), and monitoring bounds changes through `WhenRange`, and accept visitors using `Accept`.\n"]]