Add new linear constraints to a model.
GRBConstr[] | AddConstrs ( | int | count ) |
Add count
new linear constraints to a model. The new
constraints are all of the form 0 <= 0
.
Arguments:
count: Number of constraints to add.
Return value:
Array of new constraint objects.
GRBConstr[] | AddConstrs ( | GRBLinExpr[] | lhsExprs, |
char[] | senses, | ||
double[] | rhsVals, | ||
string[] | names ) |
Arguments:
lhsExprs: Left-hand side expressions for the new linear constraints.
senses: Senses for new linear constraints (GRB.LESS_EQUAL, GRB.EQUAL, or GRB.GREATER_EQUAL).
rhsVals: Right-hand side values for the new linear constraints.
names: Names for new constraints.
Return value:
Array of new constraint objects.
GRBConstr[] | AddConstrs ( | GRBLinExpr[] | lhsExprs, |
char[] | senses, | ||
GRBLinExpr[] | rhsExprs, | ||
int | start, | ||
int | len, | ||
string[] | names ) |
start
and len
arguments allow you to specify which constraints to add.
Arguments:
lhsExprs: Left-hand side expressions for the new linear constraints.
senses: Senses for new linear constraints (GRB.LESS_EQUAL, GRB.EQUAL, or GRB.GREATER_EQUAL).
rhs: Right-hand side expressions for the new linear constraints.
start: The first constraint in the list to add.
len: The number of variables to add.
names: Names for new constraints.
Return value:
Array of new constraint objects.