NO FRAMES

Class IloCplex::ControlCallbackI

Definition file: ilcplex/ilocplexi.h
Note

This is an advanced class. Advanced classes typically demand a profound understanding of the algorithms used by ILOG CPLEX. Thus they incur a higher risk of incorrect behavior in your application, behavior that can be difficult to debug. Therefore, ILOG encourages you to consider carefully whether you can accomplish the same task by means of other classes instead.

This class defines the common application programming interface (API) for the following classes that allow you to control the MIP search:

An instance of one of these classes represents a user-written callback that intervenes in the search for a solution at a given node in an application that uses an instance of IloCplex to solve a mixed integer program (MIP). Control callbacks are tied to a node. They are called at each node during IloCplex branch & cut search. The user never subclasses the IloCplex::ControlCallbackI class directly; it only defines the common interface of thosee listed callbacks.

In particular, SolveCallbackI is called before solving the node relaxation and optionally allows substitution of its solution. IloCplex does this by default. After the node relaxation has been solved, either by an instance of SolveCallbackI or by IloCplex, the other control callbacks are called in the following order:

  1. IloCplex::CutCallbackI
  2. IloCplex::HeuristicCallbackI
  3. IloCplex::BranchCallbackI

If the cut callback added new cuts to the node relaxation, the node relaxation will be solved again using the solve callback, if used. The same is true if IloCplex generated its own cuts.

The methods of this class are protected and its constructor is private; you cannot directly subclass this class; you must derive from its subclasses.

If an attempt is made to access information not available to an instance of this class, an exception is thrown.

See Also:

Method Summary
protected IloNumgetDownPseudoCost(const IloIntVar var) const
protected IloNumgetDownPseudoCost(const IloNumVar var) const
protected voidgetFeasibilities(ControlCallbackI::IntegerFeasibilityArray stat, const IloIntVarArray var) const
protected voidgetFeasibilities(ControlCallbackI::IntegerFeasibilityArray stat, const IloNumVarArray var) const
protected ControlCallbackI::IntegerFeasibilitygetFeasibility(const IloIntVar var) const
protected ControlCallbackI::IntegerFeasibilitygetFeasibility(const IloNumVar var) const
protected ControlCallbackI::IntegerFeasibilitygetFeasibility(const IloSOS2 sos) const
protected ControlCallbackI::IntegerFeasibilitygetFeasibility(const IloSOS1 sos) const
protected IloNumgetLB(const IloIntVar var) const
protected IloNumgetLB(const IloNumVar var) const
protected voidgetLBs(IloNumArray val, const IloIntVarArray vars) const
protected voidgetLBs(IloNumArray val, const IloNumVarArray vars) const
protected NodeData *getNodeData() const
protected IloNumgetObjValue() const
protected IloNumgetSlack(const IloRange rng) const
protected voidgetSlacks(IloNumArray val, const IloRangeArray con) const
protected IloNumgetUB(const IloIntVar var) const
protected IloNumgetUB(const IloNumVar var) const
protected voidgetUBs(IloNumArray val, const IloIntVarArray vars) const
protected voidgetUBs(IloNumArray val, const IloNumVarArray vars) const
protected IloNumgetUpPseudoCost(const IloIntVar var) const
protected IloNumgetUpPseudoCost(const IloNumVar var) const
protected IloNumgetValue(const IloIntVar var) const
protected IloNumgetValue(const IloNumVar var) const
protected IloNumgetValue(const IloExprArg expr) const
protected voidgetValues(IloNumArray val, const IloIntVarArray vars) const
protected voidgetValues(IloNumArray val, const IloNumVarArray vars) const
protected IloBoolisSOSFeasible(const IloSOS2 sos2) const
protected IloBoolisSOSFeasible(const IloSOS1 sos1) const
Inherited Methods from MIPCallbackI
getNcliques, getNcovers, getNdisjunctiveCuts, getNflowCovers, getNflowPaths, getNfractionalCuts, getNGUBcovers, getNimpliedBounds, getNMIRs, getObjCoef, getObjCoef, getObjCoefs, getObjCoefs, getUserThreads
Inherited Methods from MIPInfoCallbackI
getBestObjValue, getCutoff, getDirection, getDirection, getIncumbentObjValue, getIncumbentSlack, getIncumbentSlacks, getIncumbentValue, getIncumbentValue, getIncumbentValues, getIncumbentValues, getMyThreadNum, getNiterations, getNnodes, getNremainingNodes, getPriority, getPriority, hasIncumbent
Inherited Methods from OptimizationCallbackI
getModel, getNcols, getNQCs, getNrows
Inherited Methods from CallbackI
abort, duplicateCallback, getEnv, main
Inner Enumeration
ControlCallbackI::IntegerFeasibility
Inner Typedef
ControlCallbackI::IntegerFeasibilityArray
Inner Class
ControlCallbackI::PresolvedVariableException
Method Detail

getDownPseudoCost

protected IloNum getDownPseudoCost(const IloIntVar var) const

This method returns the current pseudo cost for branching downward on the variable var.


getDownPseudoCost

protected IloNum getDownPseudoCost(const IloNumVar var) const

This method returns the current pseudo cost for branching downward on the variable var.


getFeasibilities

protected void getFeasibilities(ControlCallbackI::IntegerFeasibilityArray stat, const IloIntVarArray var) const

This method specifies whether each of the variables in the array vars is integer feasible, integer infeasible, or implied integer feasible by putting the status in the corresponding element of the array stats.


getFeasibilities

protected void getFeasibilities(ControlCallbackI::IntegerFeasibilityArray stat, const IloNumVarArray var) const

This method specifies whether each of the variables in the array vars is integer feasible, integer infeasible, or implied integer feasible by putting the status in the corresponding element of the array stats.


getFeasibility

protected ControlCallbackI::IntegerFeasibility getFeasibility(const IloIntVar var) const

This method specifies whether the variable var is integer feasible, integer infeasible, or implied integer feasible in the current node solution.


getFeasibility

protected ControlCallbackI::IntegerFeasibility getFeasibility(const IloNumVar var) const

This method specifies whether the variable var is integer feasible, integer infeasible, or implied integer feasible in the current node solution.


getFeasibility

protected ControlCallbackI::IntegerFeasibility getFeasibility(const IloSOS2 sos) const

This method specifies whether the Special Ordered Set sos is integer feasible, integer infeasible, or implied integer feasible in the current node solution.


getFeasibility

protected ControlCallbackI::IntegerFeasibility getFeasibility(const IloSOS1 sos) const

This method specifies whether the Special Ordered Set sos is integer feasible, integer infeasible, or implied integer feasible in the current node solution.


getLB

protected IloNum getLB(const IloIntVar var) const

This method returns the lower bound of var at the current node. This bound is likely to be different from the bound in the original model because an instance of IloCplex tightens bounds when it branches from a node to its subnodes. The corresponding solution value from getValue may violate this bound at a node where a new incumbent has been found because the bound is tightened when an incumbent is found.

Unbounded Variables

If a variable lacks a lower bound, then getLB returns a value greater than or equal to -IloInfinity for greater than or equal to constraints with no lower bound.


getLB

protected IloNum getLB(const IloNumVar var) const

This method returns the lower bound of var at the current node. This bound is likely to be different from the bound in the original model because an instance of IloCplex tightens bounds when it branches from a node to its subnodes. The corresponding solution value from getValue may violate this bound at a node where a new incumbent has been found because the bound is tightened when an incumbent is found.

Unbounded Variables

If a variable lacks a lower bound, then getLB returns a value greater than or equal to -IloInfinity for greater than or equal to constraints with no lower bound.


getLBs

protected void getLBs(IloNumArray val, const IloIntVarArray vars) const

For each element of the array vars, this method puts the lower bound at the current node into the corresponding element of the array vals. These bounds are likely to be different from the bounds in the original model because an instance of IloCplex tightens bounds when it branches from a node to its subnodes. The corresponding solution values from getValues may violate these bounds at a node where a new incumbent has been found because the bounds are tightened when an incumbent is found.

Unbounded Variables

If a variable lacks a lower bound, then getLBs returns a value greater than or equal to -IloInfinity for greater than or equal to constraints with no lower bound.


getLBs

protected void getLBs(IloNumArray val, const IloNumVarArray vars) const

This method puts the lower bound at the current node of each element of the array vars into the corresponding element of the array vals. These bounds are likely to be different from the bounds in the original model because an instance of IloCplex tightens bounds when it branches from a node to its subnodes. The corresponding solution values from getValues may violate these bounds at a node where a new incumbent has been found because the bounds are tightened when an incumbent is found.

Unbounded Variables

If a variable lacks a lower bound, then getLBs returns a value greater than or equal to -IloInfinity for greater than or equal to constraints with no lower bound.


getNodeData

protected NodeData * getNodeData() const

This method retrieves the NodeData object that may have previously been assigned to the current node by the user with the method IloCplex::BranchCallbackI::makeBranch. If no data object has been assigned to the current node, 0 (zero) will be returned.


getObjValue

protected IloNum getObjValue() const

This method returns the objective value of the solution of the relaxation at the current node.

If you need the object representing the objective itself, consider the method IloCplex::getObjective instead.


getSlack

protected IloNum getSlack(const IloRange rng) const

This method returns the slack value for the constraint specified by rng in the solution of the relaxation at the current node.


getSlacks

protected void getSlacks(IloNumArray val, const IloRangeArray con) const

For each of the constraints in the array of ranges rngs, this method puts the slack value in the solution of the relaxation at the current node into the corresponding element of the array vals.


getUB

protected IloNum getUB(const IloIntVar var) const

This method returns the upper bound of the variable var at the current node. This bound is likely to be different from the bound in the original model because an instance of IloCplex tightens bounds when it branches from a node to its subnodes. The corresponding solution value from getValue may violate this bound at a node where a new incumbent has been found because the bound is tightened when an incumbent is found.

Unbounded Variables

If a variable lacks an upper bound, then getUB returns a value less than or equal to IloInfinity for less than or equal to constraints with no lower bound.


getUB

protected IloNum getUB(const IloNumVar var) const

This method returns the upper bound of the variable var at the current node. This bound is likely to be different from the bound in the original model because an instance of IloCplex tightens bounds when it branches from a node to its subnodes. The corresponding solution value from getValue may violate this bound at a node where a new incumbent has been found because the bound is tightened when an incumbent is found.

Unbounded Variables

If a variable lacks an upper bound, then getUB returns a value less than or equal to IloInfinity for less than or equal to constraints with no lower bound.


getUBs

protected void getUBs(IloNumArray val, const IloIntVarArray vars) const

For each element in the array vars, this method puts the upper bound at the current node into the corresponding element of the array vals. The bounds are those in the relaxation at the current node. These bounds are likely to be different from the bounds in the original model because an instance of IloCplex tightens bounds when it branches from a node to its subnodes. The corresponding solution values from getValues may violate these bounds at a node where a new incumbent has been found because the bounds are tightened when an incumbent is found.

Unbounded Variables

If a variable lacks an upper bound, then getUBs returns a value less than or equal to IloInfinity for less than or equal to constraints with no lower bound.


getUBs

protected void getUBs(IloNumArray val, const IloNumVarArray vars) const

For each element in the array vars, this method puts the upper bound at the current node into the corresponding element of the array vals. The bounds are those in the relaxation at the current node. These bounds are likely to be different from the bounds in the original model because an instance of IloCplex tightens bounds when it branches from a node to its subnodes. The corresponding solution values from getValues may violate these bounds at a node where a new incumbent has been found because the bounds are tightened when an incumbent is found.

Unbounded Variables

If a variable lacks an upper bound, then getUBs returns a value less than or equal to IloInfinity for less than or equal to constraints with no lower bound.


getUpPseudoCost

protected IloNum getUpPseudoCost(const IloIntVar var) const

This method returns the current pseudo cost for branching upward on the variable var.


getUpPseudoCost

protected IloNum getUpPseudoCost(const IloNumVar var) const

This method returns the current pseudo cost for branching upward on the variable var.


getValue

protected IloNum getValue(const IloIntVar var) const

This method returns the value of the variable var in the solution of the relaxation at the current node.


getValue

protected IloNum getValue(const IloNumVar var) const

This method returns the value of the variable var in the solution of the relaxation at the current node.


getValue

protected IloNum getValue(const IloExprArg expr) const

This method returns the value of the expression expr in the solution of the relaxation at the current node.


getValues

protected void getValues(IloNumArray val, const IloIntVarArray vars) const

For each variable in the array vars, this method puts the value in the solution of the relaxation at the current node into the corresponding element of the array vals.


getValues

protected void getValues(IloNumArray val, const IloNumVarArray vars) const

For each variable in the array vars, this method puts the value in the solution of the relaxation at the current node into the corresponding element of the array vals.


isSOSFeasible

protected IloBool isSOSFeasible(const IloSOS2 sos2) const

This method returns IloTrue if the solution of the LP at the current node is SOS feasible for the special ordered set specified in its argument. The SOS set passed as a parameter to this method may be of type 2. See the ILOG CPLEX User's Manual for more explanation of types of special ordered sets.


isSOSFeasible

protected IloBool isSOSFeasible(const IloSOS1 sos1) const

This method returns IloTrue if the solution of the LP at the current node is SOS feasible for the special ordered set specified in its argument. The SOS set passed as a parameter to this method may be of type 1. See the ILOG CPLEX User's Manual for more explanation about these types of special ordered sets.


Inner Enumeration Detail

Enumeration IntegerFeasibility

Definition file: ilcplex/ilocplexi.h

The enumeration IloCplex::ControlCallbackI::IntegerFeasibility is an enumeration limited in scope to the class IloCplex::ControlCallbackI. This enumeration is used by IloCplex::ControlCallbackI::getFeasibility to represent the integer feasibility of a variable or SOS in the current node solution:

See Also:

Fields
ImpliedInfeasible
Feasible
= CPX_INTEGER_FEASIBLE
Infeasible
= CPX_INTEGER_INFEASIBLE
ImpliedFeasible
= CPX_IMPLIED_INTEGER_FEASIBLE
Inner Typedef Detail

Typedef IntegerFeasibilityArray

Definition file: ilcplex/ilocplexi.h

IloArray< IntegerFeasibility > IntegerFeasibilityArray

This type defines an array-type for IloCplex::ControlCallbackI::IntegerFeasibility. The fully qualified name of an integer feasibility array is IloCplex::ControlCallbackI::IntegerFeasibility::Array.

See Also: