![]() |
Google OR-Tools v9.12
a fast and portable software suite for combinatorial optimization
|
Public Member Functions | |
__init__ (self, *args, **kwargs) | |
name (self) | |
Clear (self) | |
SetCoefficient (self, var, coeff) | |
GetCoefficient (self, var) | |
lb (self) | |
ub (self) | |
SetBounds (self, lb, ub) | |
set_is_lazy (self, laziness) | |
index (self) | |
dual_value (self) | |
basis_status (self) | |
Lb (self) | |
Ub (self) | |
SetLb (self, x) | |
SetUb (self, x) | |
DualValue (self) | |
Properties | |
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") | |
The class for constraints of a Mathematical Programming (MP) model. A constraint is represented as a linear equation or inequality.
Definition at line 762 of file pywraplp.py.
ortools.linear_solver.pywraplp.Constraint.__init__ | ( | self, | |
* | args, | ||
** | kwargs ) |
Definition at line 771 of file pywraplp.py.
ortools.linear_solver.pywraplp.Constraint.basis_status | ( | self | ) |
Advanced usage: returns the basis status of the constraint. It is only available for continuous problems). Note that if a constraint "linear_expression in [lb, ub]" is transformed into "linear_expression + slack = 0" with slack in [-ub, -lb], then this status is the same as the status of the slack variable with AT_UPPER_BOUND and AT_LOWER_BOUND swapped. See also: MPSolver::BasisStatus.
Definition at line 838 of file pywraplp.py.
ortools.linear_solver.pywraplp.Constraint.Clear | ( | self | ) |
Clears all variables and coefficients. Does not clear the bounds.
Definition at line 779 of file pywraplp.py.
ortools.linear_solver.pywraplp.Constraint.dual_value | ( | self | ) |
Advanced usage: returns the dual value of the constraint in the current solution (only available for continuous problems).
Definition at line 831 of file pywraplp.py.
ortools.linear_solver.pywraplp.Constraint.DualValue | ( | self | ) |
Definition at line 865 of file pywraplp.py.
ortools.linear_solver.pywraplp.Constraint.GetCoefficient | ( | self, | |
var ) |
Gets the coefficient of a given variable on the constraint (which is 0 if the variable does not appear in the constraint).
Definition at line 792 of file pywraplp.py.
ortools.linear_solver.pywraplp.Constraint.index | ( | self | ) |
Returns the index of the constraint in the MPSolver::constraints_.
Definition at line 827 of file pywraplp.py.
ortools.linear_solver.pywraplp.Constraint.Lb | ( | self | ) |
Definition at line 853 of file pywraplp.py.
ortools.linear_solver.pywraplp.Constraint.lb | ( | self | ) |
Returns the lower bound.
Definition at line 799 of file pywraplp.py.
ortools.linear_solver.pywraplp.Constraint.name | ( | self | ) |
Returns the name of the constraint.
Definition at line 775 of file pywraplp.py.
ortools.linear_solver.pywraplp.Constraint.set_is_lazy | ( | self, | |
laziness ) |
Advanced usage: sets the constraint "laziness". **This is only supported for SCIP and has no effect on other solvers.** When **laziness** is true, the constraint is only considered by the Linear Programming solver if its current solution violates the constraint. In this case, the constraint is definitively added to the problem. This may be useful in some MIP problems, and may have a dramatic impact on performance. For more info see: http://tinyurl.com/lazy-constraints.
Definition at line 811 of file pywraplp.py.
ortools.linear_solver.pywraplp.Constraint.SetBounds | ( | self, | |
lb, | |||
ub ) |
Sets both the lower and upper bounds.
Definition at line 807 of file pywraplp.py.
ortools.linear_solver.pywraplp.Constraint.SetCoefficient | ( | self, | |
var, | |||
coeff ) |
Sets the coefficient of the variable on the constraint. If the variable does not belong to the solver, the function just returns, or crashes in non-opt mode.
Definition at line 783 of file pywraplp.py.
ortools.linear_solver.pywraplp.Constraint.SetLb | ( | self, | |
x ) |
Definition at line 859 of file pywraplp.py.
ortools.linear_solver.pywraplp.Constraint.SetUb | ( | self, | |
x ) |
Definition at line 862 of file pywraplp.py.
ortools.linear_solver.pywraplp.Constraint.Ub | ( | self | ) |
Definition at line 856 of file pywraplp.py.
ortools.linear_solver.pywraplp.Constraint.ub | ( | self | ) |
Returns the upper bound.
Definition at line 803 of file pywraplp.py.
|
static |
Definition at line 769 of file pywraplp.py.