| Overview | Group | Tree | Graph | Deprecated | Index | Concepts |

This is an advanced class. Advanced classes typically demand a profound understanding of the algorithms used by CPLEX. Thus they incur a higher risk of incorrect behavior in your application, behavior that can be difficult to debug. Therefore, the team encourages you to consider carefully whether you can accomplish the same task by means of other classes instead.
An instance of the class IloCplex::SolveCallbackI can be
used to solve subproblems (for example, node and heuristic
subproblems) during branch-and-cut search. It allows
you to set a starting point for the solve or to select the algorithm on a
per-node basis.
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.
See Also:
IloCplex, IloCplex::Callback, IloCplex::CallbackI, IloCplex::ControlCallbackI, IloCplex::OptimizationCallbackI, ILOSOLVECALLBACK0
| Method Summary | |
|---|---|
public IloCplex::CplexStatus | getCplexStatus() const |
public IloAlgorithm::Status | getStatus() const |
protected Callback::Type | getType() const |
public IloBool | isDualFeasible() const |
public IloBool | isPrimalFeasible() const |
public void | setStart(const IloNumArray x, const IloIntVarArray var, const IloNumArray pi, const IloRangeArray rng) |
public void | setStart(const IloNumArray x, const IloNumVarArray var, const IloNumArray pi, const IloRangeArray rng) |
public IloBool | solve(IloCplex::Algorithm alg=Dual) |
protected | SolveCallbackI(IloEnv env) |
public void | useSolution() |
Inherited Methods from MIPCallbackI |
|---|
getCurrentNodeDepth, getObjCoef, getObjCoef, getObjCoefs, getObjCoefs, getType, getUserThreads, MIPCallbackI |
Inherited Methods from OptimizationCallbackI |
|---|
getModel, getNcols, getNQCs, getNrows |
Inherited Methods from CallbackI |
|---|
abort, duplicateCallback, getCplexTime, getDetTime, getEndDetTime, getEndTime, getEnv, getStartDetTime, getStartTime, getType, main |
| Method Detail |
|---|
This constructor creates a callback for use in an application for solving the node LPs during branch-and-cut searches.
This method returns the CPLEX status of the instance of
IloCplex at the current node (that is, the state of the
optimizer at the node) during the last call to
SolveCallbackI::solve
(which may have been called directly in the callback
or by IloCplex when processing the node).
The enumeration IloCplex::CplexStatus
lists the possible status values.
This method returns the status of the solution found by the
instance of IloCplex
at the current node during the last call
to SolveCallbackI::solve (which may have been called
directly in the callback or by IloCplex when processing the
node).
The enumeration IloAlgorithm::Status lists the possible
status values.
This method returns IloTrue if the solution provided
by the last solve call is dual feasible. Note that an
IloFalse return value does not necessarily mean that the
solution is not dual feasible. It simply means that the relevant
algorithm was not able to conclude it was dual feasible when it
terminated.
This method returns IloTrue if the solution provided
by the last solve call is primal feasible. Note that an
IloFalse return value does not necessarily mean that the
solution is not primal feasible. It simply means that the relevant
algorithm was not able to conclude it was primal feasible when it
terminated.
This method allows a user to specify a starting point
for the following
invocation of the solve method in a solve callback.
Zero can be passed for any of the arguments. However, if x
is not zero, then var must not be zero either.
Similarly, if pi is not zero, then
rng must not be zero either.
When CPLEX is solving a MIP and the argument pi is not
zero, then you must disable presolve. If you do not
disable presolve in those conditions, then the method
set fails when it is unable to crush a pi
vector for the original model into appropriate values for the
presolved model.
For all variables in var, x[i] specifies
the starting value for the variable var[i]. Similarly,
for all ranged constraints specified in
rng, pi[i] specifies
the starting dual value for rng[i].
CPLEX uses this information at the next call to solve
to construct a starting point for the algorithm.
This method allows a user to specify
a starting point for the following
invocation of the solve method in a solve callback.
Zero can be passed for any of the arguments. However, if x
is not zero, then var must not be zero either.
Similarly, if pi is not zero, then
rng must not be zero either.
When CPLEX is solving a MIP and the argument pi is not
zero, then you must disable presolve. If you do not
disable presolve in those conditions, then the method
setStart fails when it is unable to crush a pi
vector for the original model into appropriate values for the
presolved model.
For all variables in var, x[i] specifies
the starting value for the variable var[i]. Similarly,
for all ranged constraints specified in
rng, pi[i] specifies
the starting dual value for rng[i].
CPLEX uses this information at the next call to solve
to construct a starting point for the algorithm.
This method uses the algorithm alg to solve the
current node LP. See IloCplex::Algorithm
for a choice of algorithms to use.
A call to this method instructs IloCplex to use the
solution generated with this callback.
If useSolution is not called, IloCplex uses
the algorithm selected with the parameters IloCplex::RootAlg
for the solution of the root, or IloCplex::NodeAlg to solve
the node.
This method returns the callback type of the invoking callback object.