ILOG CPLEX .NET Reference Manual

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

Changes the upper and lower bounds of variable var.

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

Parameters

var
The variable whose bounds are to be changed.
lb
The lower bound of var to be changed.
ub
The upper bound of var to be changed.

Remarks

For the variable var, this method sets its upper bound to the corresponding value ub and its lower bound to the value 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