public class MPConstraint
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
swigCMemOwn |
| Modifier | Constructor and Description |
|---|---|
protected |
MPConstraint(long cPtr,
boolean cMemoryOwn) |
| Modifier and Type | Method and Description |
|---|---|
MPSolver.BasisStatus |
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. |
void |
delete() |
double |
dualValue()
Advanced usage: returns the dual value of the constraint in the current
solution (only available for continuous problems). |
protected void |
finalize() |
double |
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). |
protected static long |
getCPtr(MPConstraint obj) |
int |
index()
Returns the index of the constraint in the MPSolver::constraints_.
|
boolean |
isLazy()
Advanced usage: returns true if the constraint is "lazy" (see below).
|
double |
lb()
Returns the lower bound.
|
java.lang.String |
name()
Returns the name of the constraint.
|
void |
setBounds(double lb,
double ub)
Sets both the lower and upper bounds.
|
void |
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. |
void |
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. |
void |
setLb(double lb)
Sets the lower bound.
|
void |
setUb(double ub)
Sets the upper bound.
|
protected static long |
swigRelease(MPConstraint obj) |
double |
ub()
Returns the upper bound.
|
protected static long getCPtr(MPConstraint obj)
protected static long swigRelease(MPConstraint obj)
protected void finalize()
finalize in class java.lang.Objectpublic void delete()
public java.lang.String name()
public void setCoefficient(MPVariable var, double coeff)
public double getCoefficient(MPVariable var)
public double lb()
public double ub()
public void setLb(double lb)
public void setUb(double ub)
public void setBounds(double lb,
double ub)
public boolean isLazy()
public void setIsLazy(boolean laziness)
public int index()
public double dualValue()
public MPSolver.BasisStatus basisStatus()
MPSolver#BasisStatus.Copyright © 2024. All rights reserved.