GRBchgcoeffs
| int | GRBchgcoeffs ( | GRBmodel | *model, |
| int | numchgs, | ||
| int | *cind, | ||
| int | *vind, | ||
| double | *val ) |
Change a set of constraint matrix coefficients. This routine can be used to set a non-zero coefficient to zero, to create a non-zero coefficient where the coefficient is currently zero, or to change an existing non-zero coefficient to a new non-zero value.
Note that the changes won't take effect until the next call to GRBoptimize or GRBupdatemodel.
Return value:
A non-zero return value indicates that a problem occurred while performing the modification. Refer to the Error Code table for a list of possible return values. Details on the error can be obtained by calling GRBgeterrormsg.
Arguments:
model: The model to modify.
numchgs: The number of coefficients to modify.
cind: Constraint indices for the coefficients to modify.
vind: Variable indices for the coefficients to modify.
val: The new values for the coefficients. For example, if cind[0] = 1, vind[0] = 3, and val[0] = 2.0, then the coefficient in constraint 1 associated with variable 3 would be changed to 2.0.
Example usage:
int cind[] = {0, 1};
int vind[] = {0, 0};
double val[] = {1.0, 1.0};
error = GRBchgcoeffs(model, 2, cind, vind, val);
