ILOG CPLEX .NET Reference Manual

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

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

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

Parameters

var
The array containing the variables for which the bounds are to be changed.
lb
The array containing the lower bounds to be set. The lower bound of variable var[j] will be set to lb[j].
ub
The array containing the upper bounds to be set. The upper bound of variable var[j] will be set to ub[j].
start
The index of the first variable in var for which the bounds are to be set.
num
The number of consecutive variables in var for which the bounds are to be set.

Remarks

For each variable selected from 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