Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
|
Public Member Functions | |
synchronized void | delete () |
String | name () |
void | setCoefficient (MPVariable var, double coeff) |
double | getCoefficient (MPVariable var) |
double | lb () |
double | ub () |
void | setLb (double lb) |
void | setUb (double ub) |
void | setBounds (double lb, double ub) |
boolean | isLazy () |
void | setIsLazy (boolean laziness) |
int | index () |
double | dualValue () |
MPSolver.BasisStatus | basisStatus () |
Protected Member Functions | |
MPConstraint (long cPtr, boolean cMemoryOwn) | |
void | finalize () |
Static Protected Member Functions | |
static long | getCPtr (MPConstraint obj) |
static long | swigRelease (MPConstraint obj) |
Protected Attributes | |
transient boolean | swigCMemOwn |
The class for constraints of a Mathematical Programming (MP) model.
A constraint is represented as a linear equation or inequality.
Definition at line 18 of file MPConstraint.java.
|
protected |
Definition at line 22 of file MPConstraint.java.
MPSolver.BasisStatus com.google.ortools.linearsolver.MPConstraint.basisStatus | ( | ) |
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.
Definition at line 169 of file MPConstraint.java.
synchronized void com.google.ortools.linearsolver.MPConstraint.delete | ( | ) |
Definition at line 48 of file MPConstraint.java.
double com.google.ortools.linearsolver.MPConstraint.dualValue | ( | ) |
Advanced usage: returns the dual value of the constraint in the current
solution (only available for continuous problems).
Definition at line 153 of file MPConstraint.java.
|
protected |
Definition at line 44 of file MPConstraint.java.
double com.google.ortools.linearsolver.MPConstraint.getCoefficient | ( | MPVariable | 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 79 of file MPConstraint.java.
|
staticprotected |
Definition at line 27 of file MPConstraint.java.
int com.google.ortools.linearsolver.MPConstraint.index | ( | ) |
Returns the index of the constraint in the MPSolver::constraints_.
Definition at line 145 of file MPConstraint.java.
boolean com.google.ortools.linearsolver.MPConstraint.isLazy | ( | ) |
Advanced usage: returns true if the constraint is "lazy" (see below).
Definition at line 121 of file MPConstraint.java.
double com.google.ortools.linearsolver.MPConstraint.lb | ( | ) |
Returns the lower bound.
Definition at line 86 of file MPConstraint.java.
String com.google.ortools.linearsolver.MPConstraint.name | ( | ) |
Returns the name of the constraint.
Definition at line 61 of file MPConstraint.java.
void com.google.ortools.linearsolver.MPConstraint.setBounds | ( | double | lb, |
double | ub ) |
Sets both the lower and upper bounds.
Definition at line 114 of file MPConstraint.java.
void com.google.ortools.linearsolver.MPConstraint.setCoefficient | ( | MPVariable | var, |
double | 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 71 of file MPConstraint.java.
void com.google.ortools.linearsolver.MPConstraint.setIsLazy | ( | boolean | 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 138 of file MPConstraint.java.
void com.google.ortools.linearsolver.MPConstraint.setLb | ( | double | lb | ) |
Sets the lower bound.
Definition at line 100 of file MPConstraint.java.
void com.google.ortools.linearsolver.MPConstraint.setUb | ( | double | ub | ) |
Sets the upper bound.
Definition at line 107 of file MPConstraint.java.
|
staticprotected |
Definition at line 31 of file MPConstraint.java.
double com.google.ortools.linearsolver.MPConstraint.ub | ( | ) |
Returns the upper bound.
Definition at line 93 of file MPConstraint.java.
|
protected |
Definition at line 20 of file MPConstraint.java.