Overview | Group | Tree | Graph | Index | Concepts |
An instance of the class IloCplex::MIPInfoCallbackI
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 regularly
during the branch & cut search.
User-written callbacks of this class are compatible with MIP dynamic search.
This class offers methods for accessing an incumbent solution and its objective value from a user-written callback. It also offers methods for accessing priority orders and progress information, such as the number of nodes solved.
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 in a user-written callback to access information not available to an instance of this class, an exception is raised. 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:
IloCplex, IloCplex::Callback, IloCplex::CallbackI, IloCplex::DisjunctiveCutInfoCallbackI, IloCplex::FlowMIRCutInfoCallbackI, IloCplex::FractionalCutInfoCallbackI, IloCplex::OptimizationCallbackI, IloCplex::ProbingInfoCallbackI, ILOMIPINFOCALLBACK0
Constructor Summary | |
---|---|
protected | MIPInfoCallbackI(IloEnv env) |
Method Summary | |
---|---|
protected IloNum | getBestObjValue() const |
protected IloNum | getCutoff() const |
protected IloCplex::BranchDirection | getDirection(const IloIntVar var) const |
protected IloCplex::BranchDirection | getDirection(const IloNumVar var) const |
protected IloNum | getIncumbentObjValue() const |
protected IloNum | getIncumbentSlack(const IloRange rng) const |
protected void | getIncumbentSlacks(IloNumArray vals, const IloRangeArray cons) const |
protected IloNum | getIncumbentValue(const IloIntVar var) const |
protected IloNum | getIncumbentValue(const IloNumVar var) const |
protected void | getIncumbentValues(IloNumArray val, const IloIntVarArray vars) const |
protected void | getIncumbentValues(IloNumArray val, const IloNumVarArray vars) const |
protected IloInt | getMyThreadNum() const |
protected IloInt | getNiterations() const |
protected IloInt | getNnodes() const |
protected IloInt | getNremainingNodes() const |
protected IloNum | getPriority(const IloIntVar sos) const |
protected IloNum | getPriority(const IloNumVar sos) const |
protected IloBool | hasIncumbent() const |
Inherited Methods from OptimizationCallbackI |
---|
getModel, getNcols, getNQCs, getNrows |
Inherited Methods from CallbackI |
---|
abort, duplicateCallback, getEnv, main |
Constructor Detail |
---|
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 |
---|
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.
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.
This method returns the branch direction previously assigned to
variable var
with method
IloCplex::setDirection
or
IloCplex::setDirections
.
If no direction has been assigned,
IloCplex::BranchGlobal
will be returned.
This method returns the branch direction previously assigned to
variable var
with method
IloCplex::setDirection
or
IloCplex::setDirections
.
If no direction has been assigned,
IloCplex::BranchGlobal
will be returned.
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.
This method returns the slack value for the range specified by
rng
for the incumbent.
If there is no incumbent, this method
throws an exception.
This method puts the slack value for each range in the array of
ranges cons
into the corresponding element of the array
vals
for the incumbent. CPLEX resizes
array vals
to match the size of array cons
.
If there is no incumbent, this method
throws an exception.
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.
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.
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.
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.
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
.
This method returns a nonzero value only
for the class IloCplex::MIPCallbackI
and its
subclasses. In other words, this method is valid only
for query, diagnostic, and control callbacks. It is
not valid for informational callbacks.
Returns the total number of iterations executed so far during the current optimization to solve the node relaxations.
Returns the number of nodes already processed in the current optimization.
Returns the number of nodes left to explore in the current optimization.
Returns the branch priority used for
variable var
in the current optimization.
Returns the branch priority used for
variable var
in the current optimization.
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.