ILOG CPLEX .NET Reference Manual

Cplex.HeuristicCallback.SetBounds Method (INumVar[], Double[], Double[])

Changes the upper and lower bounds of variables in the array var.

protected virtual void SetBounds(
   INumVar[] var,
   double[] lb,
   double[] ub
);

Parameters

var
The array of variables for which the bounds are to be changed.
lb
The array of lower bounds to be set. The lower bound of variable var[j] will be set to lb[j].
ub
The array of upper bounds to be set. The upper bound of variable var[j] will be set to ub[j].

Remarks

For each variable in the array var, this method sets its upper bound to the corresponding value in the array ub and its lower bound to the corresponding value in the array lb. Setting bounds has no effect beyond the scope of the current invocation of the callback.

Use this method only when presolve is turned off. Otherwise, you risk attempting to change the bounds of a variable that has been removed during the presolve. To check whether presolve is off, consider the parameter Cplex.BooleanParam.PreInd. Alternatively, you can check whether a particular variable has been removed by presolve by checking the status of the variable. To do so, call IloControlCallback.GetFeasibilities. A variable that has been removed by presolve will have the status ImpliedFeasible.

See Also

Cplex.HeuristicCallback Class | ILOG.CPLEX Namespace | Cplex.HeuristicCallback.SetBounds Overload List