NO FRAMES

Class IloCplex::MIPCallbackI

Definition file: ilocplexi.h
Include files: ilcplex/ilocplex.h

An instance of the class IloCplex::MIPCallbackI represents a user-written callback in an application that uses an instance of IloCplex to solve a mixed integer program (MIP). IloCplex calls the user-written callback prior to solving each node in branch & cut search. This class offers member functions for accessing an incumbent solution and its objective value from a user-written callback. It also offers methods for accessing priority orders and statistical information such as the number of cuts. Methods are also available to query the number of generated cuts for each type of cut CPLEX generates. See the ILOG CPLEX User's Manual for more information about cuts.

The methods of this class are protected for use in deriving a user-written callback class and in implementing the main method there.

If an attempt is made to access information not available to an instance of this class, an exception is thrown. For example, if there is no incumbent, the methods that query about incumbents will throw an exception.

This class also provides the common application programming interface (API) for these callback classes:

See Also:

Constructor Summary
protected MIPCallbackI()
Method Summary
protected IloNumgetBestObjValue()
protected IloNumgetCutoff()
protected IloCplex::BranchDirectiongetDirection(const IloIntVar)
protected IloCplex::BranchDirectiongetDirection(const IloNumVar)
protected IloNumgetIncumbentObjValue()
protected IloNumgetIncumbentValue(const IloIntVar)
protected IloNumgetIncumbentValue(const IloNumVar)
protected voidgetIncumbentValues(IloNumArray, const IloIntVarArray)
protected voidgetIncumbentValues(IloNumArray, const IloNumVarArray)
protected IloIntgetMyThreadNum()
protected IloIntgetNcliques()
protected IloIntgetNcovers()
protected IloIntgetNdisjunctiveCuts()
protected IloIntgetNflowCovers()
protected IloIntgetNflowPaths()
protected IloIntgetNfractionalCuts()
protected IloIntgetNGUBcovers()
protected IloIntgetNimpliedBounds()
protected IloIntgetNiterations()
protected IloIntgetNMIRs()
protected IloIntgetNnodes()
protected IloIntgetNremainingNodes()
protected IloNumgetObjCoef(const IloIntVar)
protected IloNumgetObjCoef(const IloNumVar)
protected voidgetObjCoefs(IloNumArray, const IloIntVarArray)
protected voidgetObjCoefs(IloNumArray, const IloNumVarArray)
protected IloNumgetPriority(const IloIntVar)
protected IloNumgetPriority(const IloNumVar)
protected IloIntgetUserThreads()
protected IloBoolhasIncumbent()
Inherited Methods from CallbackI
abort, duplicateCallback, getEnv, getModel, getNcols, getNQCs, getNrows, main
Inner Class
MIPCallbackI::NodeData
Constructor Detail

MIPCallbackI

protected MIPCallbackI()

This constructor creates a callback for use in an application that uses an instance of IloCplex to solve a mixed integer program (MIP).


Method Detail

getBestObjValue

protected IloNum getBestObjValue()

This method returns the currently best known bound on the optimal solution value of the problem at the time the invoking callback is called by an instance of IloCplex while solving a MIP. When a model has been solved to optimality, this value matches the optimal solution value. Otherwise, this value is computed for a minimization (maximization) problem as the minimum (maximum) objective function value of all remaining unexplored nodes.


getCutoff

protected IloNum getCutoff()
Returns the current cutoff value.

An instance of IloCplex uses the cutoff value (the value of the objective function of the subproblem at a node in the search tree) to decide when to prune nodes from the search tree (that is, when to cut off that node and discard the nodes beyond it). The cutoff value is updated whenever a new incumbent is found.


getDirection

protected IloCplex::BranchDirection getDirection(const IloIntVar var)

Returns the IloCplex::BranchDirection used for variable var in the current optimization.


getDirection

protected IloCplex::BranchDirection getDirection(const IloNumVar var)

Returns the IloCplex::BranchDirection used for variable var in the current optimization.


getIncumbentObjValue

protected IloNum getIncumbentObjValue()

Returns the value of the objective function of the incumbent solution (that is, the best integer solution found so far) at the time the invoking callback is called by an instance of IloCplex while solving a MIP. If there is no incumbent, this method throws an exception.


getIncumbentValue

protected IloNum getIncumbentValue(const IloIntVar var)

Returns the solution value of var in the incumbent solution at the time the invoking callback is called by an instance of IloCplex while solving a MIP. If there is no incumbent, this method throws an exception.


getIncumbentValue

protected IloNum getIncumbentValue(const IloNumVar var)

Returns the solution value of var in the incumbent solution at the time the invoking callback is called by an instance of IloCplex while solving a MIP. If there is no incumbent, this method throws an exception.


getIncumbentValues

protected void getIncumbentValues(IloNumArray val, const IloIntVarArray vars)

Returns the value of each variable in the array vars with respect to the current incumbent solution, and it puts those values into the corresponding array vals. If there is no incumbent, this method throws an exception.


getIncumbentValues

protected void getIncumbentValues(IloNumArray val, const IloNumVarArray vars)

Returns the value of each variable in the array vars with respect to the current incumbent solution, and it puts those values into the corresponding array vals. If there is no incumbent, this method throws an exception.


getMyThreadNum

protected IloInt getMyThreadNum()

Returns the identifier of the parallel thread being currently executed. This number is between 0 (zero) and the value returned by the method getUserThreads()-1.


getNGUBcovers

protected IloInt getNGUBcovers()

Returns the total number of GUB cover cuts that have been added to the model so far during the current optimization.


getNMIRs

protected IloInt getNMIRs()

Returns the total number of MIR cuts that have been added to the model so far during the current optimization.


getNcliques

protected IloInt getNcliques()

Returns the total number of clique cuts that have been added to the model so far during the current optimization.


getNcovers

protected IloInt getNcovers()

Returns the total number of cover cuts that have been added to the model so far during the current optimization.


getNdisjunctiveCuts

protected IloInt getNdisjunctiveCuts()

Returns the total number of disjunctive cuts that have been added to the model so far during the current optimization.


getNflowCovers

protected IloInt getNflowCovers()

Returns the total number of flow cover cuts that have been added to the model so far during the current optimization.


getNflowPaths

protected IloInt getNflowPaths()

Returns the total number of flow path cuts that have been added to the model so far during the current optimization.


getNfractionalCuts

protected IloInt getNfractionalCuts()

Returns the total number of fractional cuts that have been added to the model so far during the current optimization.


getNimpliedBounds

protected IloInt getNimpliedBounds()

Returns the total number of implied bound cuts that have been added to the model so far during the current optimization.


getNiterations

protected IloInt getNiterations()

Returns the total number of iterations executed so far during the current optimization to solve the node relaxations.


getNnodes

protected IloInt getNnodes()

Returns the number of nodes already processed in the current optimization.


getNremainingNodes

protected IloInt getNremainingNodes()

Returns the number of nodes left to explore in the current optimization.


getObjCoef

protected IloNum getObjCoef(const IloIntVar var)

Returns the linear objective coefficient for var in the model currently being solved.


getObjCoef

protected IloNum getObjCoef(const IloNumVar var)

Returns the linear objective coefficient for var in the model currently being solved.


getObjCoefs

protected void getObjCoefs(IloNumArray val, const IloIntVarArray vars)

Puts the linear objective coefficient of each of the variables in the array vars into the corresponding element of the array vals.


getObjCoefs

protected void getObjCoefs(IloNumArray val, const IloNumVarArray vars)

Puts the linear objective coefficient of each of the variables in the array vars into the corresponding element of the array vals.


getPriority

protected IloNum getPriority(const IloIntVar sos)

Returns the branch priority used for variable var in the current optimization.


getPriority

protected IloNum getPriority(const IloNumVar sos)

Returns the branch priority used for variable var in the current optimization.


getUserThreads

protected IloInt getUserThreads()

Returns the total number of parallel threads currently running.


hasIncumbent

protected IloBool hasIncumbent()

Returns IloTrue if an integer feasible solution has been found, or, equivalenty, if an incumbent solution is available at the time the invoking callback is called by an instance of IloCplex while solving a MIP.