![]() |
Google OR-Tools v9.14
a fast and portable software suite for combinatorial optimization
|
Represents [coeff * variable + constant] or just a [constant].
In some places it is useful to manipulate such expression instead of having to create an extra integer variable. This is mainly used for scheduling related constraints.
Definition at line 268 of file integer_base.h.
#include <integer_base.h>
Public Member Functions | |
AffineExpression ()=default | |
Helper to construct an AffineExpression. | |
AffineExpression (IntegerValue cst) | |
AffineExpression (IntegerVariable v) | |
AffineExpression (IntegerVariable v, IntegerValue c) | |
AffineExpression (IntegerVariable v, IntegerValue c, IntegerValue cst) | |
IntegerLiteral | GreaterOrEqual (IntegerValue bound) const |
var * coeff + constant >= bound. | |
IntegerLiteral | LowerOrEqual (IntegerValue bound) const |
var * coeff + constant <= bound. | |
AffineExpression | Negated () const |
AffineExpression | MultipliedBy (IntegerValue multiplier) const |
bool | operator== (AffineExpression o) const |
IntegerValue | ValueAt (IntegerValue var_value) const |
Returns the value of this affine expression given its variable value. | |
double | LpValue (const util_intops::StrongVector< IntegerVariable, double > &lp_values) const |
Returns the affine expression value under a given LP solution. | |
bool | IsConstant () const |
std::string | DebugString () const |
Public Attributes | |
IntegerVariable | var = kNoIntegerVariable |
IntegerValue | coeff = IntegerValue(0) |
IntegerValue | constant = IntegerValue(0) |
|
default |
Helper to construct an AffineExpression.
|
inline |
Definition at line 271 of file integer_base.h.
|
inline |
Definition at line 273 of file integer_base.h.
|
inline |
Definition at line 275 of file integer_base.h.
|
inline |
Definition at line 277 of file integer_base.h.
|
inline |
Definition at line 316 of file integer_base.h.
|
inline |
var * coeff + constant >= bound.
Returns the integer literal corresponding to expression >= value or expression <= value.
On constant expressions, they will return IntegerLiteral::TrueLiteral() or IntegerLiteral::FalseLiteral().
Definition at line 550 of file integer_base.h.
|
inline |
Definition at line 314 of file integer_base.h.
|
inline |
var * coeff + constant <= bound.
Definition at line 562 of file integer_base.h.
|
inline |
Returns the affine expression value under a given LP solution.
Definition at line 308 of file integer_base.h.
|
inline |
Definition at line 293 of file integer_base.h.
|
inline |
Definition at line 288 of file integer_base.h.
|
inline |
Definition at line 298 of file integer_base.h.
|
inline |
Returns the value of this affine expression given its variable value.
Definition at line 303 of file integer_base.h.
IntegerValue operations_research::sat::AffineExpression::coeff = IntegerValue(0) |
Definition at line 331 of file integer_base.h.
IntegerValue operations_research::sat::AffineExpression::constant = IntegerValue(0) |
Definition at line 332 of file integer_base.h.
IntegerVariable operations_research::sat::AffineExpression::var = kNoIntegerVariable |
The coefficient MUST be positive. Use NegationOf(var) if needed.
Definition at line 330 of file integer_base.h.