Try our new documentation site (beta).
Next: GRBModel::addGenConstrPoly() Up: GRBModel::addGenConstrXxx() Previous: GRBModel::addGenConstrIndicator()
GRBModel::addGenConstrPWL()
Add a new general constraint of type GRB_GENCONSTR_PWL to a model.
A piecewise-linear (PWL) constraint states that the relationship must hold between variables and , where is a piecewise-linear function. The breakpoints for are provided as arguments. Refer to the description of piecewise-linear objectives for details of how piecewise-linear functions are defined.
GRBGenConstr | addGenConstrPWL ( | GRBVar | xvar, |
GRBVar | yvar, | ||
int | npts, | ||
const double* | xpts, | ||
const double* | ypts, | ||
std::string | name="" ) |
Arguments:
xvar: The variable.
yvar: The variable.
npts: The number of points that define the piecewise-linear function.
xpts: The values for the points that define the piecewise-linear function. Must be in non-decreasing order.
ypts: The values for the points that define the piecewise-linear function.
name (optional): Name for the new general constraint.
Return value:
New general constraint.
Next: GRBModel::addGenConstrPoly() Up: GRBModel::addGenConstrXxx() Previous: GRBModel::addGenConstrIndicator()