public abstract static class IloCplex.SolveCallback extends IloCplex.ControlCallback
An instance of this class can be used to solve subproblems during a branch-and-cut search. It allows you to set a starting point when a node is being solved or to select the solution algorithm on a per-node basis.
The constructor and methods of this class are protected to
make sure that they
are used only to derive a user-written callback class or to implement
the main method in it.
IloCplex.ControlCallbackIloCplex.MIPCallback.NodeDataIloCplex.Callback.Context, IloCplex.Callback.Function| Modifier | Constructor and Description |
|---|---|
protected |
IloCplex.SolveCallback()
Constructor for user-written solve callback.
|
| Modifier and Type | Method and Description |
|---|---|
protected IloCplex.CplexStatus |
getCplexStatus()
Returns the
IloCplex.CplexStatus of the last
solve call. |
protected IloCplex.Status |
getStatus()
Returns the solution status of the last
solve call. |
boolean |
isDualFeasible()
Returns
true if a dual feasible solution is available for
the current node. |
boolean |
isPrimalFeasible()
Returns
true if a primal feasible solution is
available for the current node. |
protected void |
setStart(double[] x,
IloNumVar[] var,
double[] pi,
IloRange[] rng)
Specifies a starting point for the next invocation of the method
solve during the current solve callback. |
protected void |
setStart(double[] x,
IloNumVar[] var,
int xstart,
int xnum,
double[] pi,
IloRange[] rng,
int cstart,
int cnum)
Specifies a starting point for the next invocation of the method
solve during the current solve callback. |
protected boolean |
solve()
Solves the current node using the default algorithm
(
IloCplex.Algorithm.Auto). |
protected boolean |
solve(int alg)
Solves the current node using the algorithm
alg. |
protected void |
useSolution()
Instructs
IloCplex to use a solution. |
getDownPseudoCost, getFeasibilities, getFeasibilities, getFeasibility, getLB, getLBs, getLBs, getNodeData, getNodeId, getObjValue, getSlack, getSlacks, getSlacks, getSOSFeasibility, getSOSFeasibility, getUB, getUBs, getUBs, getUpPseudoCost, getValue, getValue, getValues, getValues, setNodeDatagetCurrentNodeDepth, getNodeDoubleInfo, getNodeIntInfo, getNodeLongInfo, getObjCoef, getObjCoefs, getObjCoefsgetBestObjValue, getCutoff, getDirection, getIncumbentObjValue, getIncumbentValue, getIncumbentValue, getIncumbentValues, getIncumbentValues, getMIPRelativeGap, getNcuts, getNiterations, getNiterations64, getNnodes, getNnodes64, getNremainingNodes, getNremainingNodes64, getPriority, getQuality, hasIncumbentgetModel, getNcols, getNQCs, getNrowsabort, getCplexTime, getDetTime, getEndDetTime, getEndTime, getStartDetTime, getStartTime, mainprotected IloCplex.SolveCallback()
IloCplex.SolveCallback objects directly.protected boolean solve(int alg)
throws IloException
alg.
See
IloCplex.Algorithm
for a choice of algorithms to use.
IloExceptionalg - The IloCplex.Algorithm to use to solve the
current node.protected boolean solve()
throws IloException
IloCplex.Algorithm.Auto).IloExceptionprotected IloCplex.Status getStatus() throws IloException
solve call.IloExceptionsolve call.protected IloCplex.CplexStatus getCplexStatus() throws IloException
IloCplex.CplexStatus of the last
solve call.IloExceptionIloCplex.CplexStatus of the last
solve call.public boolean isDualFeasible()
throws IloException
true if a dual feasible solution is available for
the current node. If false is returned, the solution may
still be dual feasible, but the algorithm has not determined the
feasibility before it terminated.
IloExceptionpublic boolean isPrimalFeasible()
throws IloException
true if a primal feasible solution is
available for the current node.
If false is returned, the solution may
still be primal feasible, but the algorithm did not determine the
feasibility before it terminated.
IloExceptionprotected void useSolution()
IloCplex to use a solution.
This method instructs IloCplex
to use the solution generated with
this callback instead of solving the node itself.
If useSolution is not called, IloCplex
uses the algorithm selected with the parameter
IloCplex.IntParam.RootAlg or
IloCplex.IntParam.NodeAlg to solve the node.
protected void setStart(double[] x,
IloNumVar[] var,
double[] pi,
IloRange[] rng)
throws IloException
solve during the current solve callback.
Starting point information is exploited at the next call
of the method solve before the termination of the
SolveCallback.main function currently being executed.
In particular, if the node is being solved with
the simplex optimizer, the starting point information
provided with this method is used to construct a starting basis for
the simplex optimizer.
The starting point information is provided in the arguments of this
method. NULL can be passed for any of
the arguments. However, if x is not
NULL, var must not be NULL.
Similarly, if pi is not
NULL, rng must not be NULL.
IloExceptionprotected void setStart(double[] x,
IloNumVar[] var,
int xstart,
int xnum,
double[] pi,
IloRange[] rng,
int cstart,
int cnum)
throws IloException
solve during the current solve callback.
Starting point information is exploited at the next call
of the method solve before the termination of the
SolveCallback.main function being currently executed.
In particular, if the node is being solved with
the simplex optimizer, the starting point information
provided with this method is used to construct a starting basis for
the simplex optimizer.
The starting point information is provided in the arguments of this
method. NULL can be passed for any of
the arguments. However, if x is not
NULL, var must not be NULL.
Similarly, if pi is not
NULL, rng must not be NULL.
IloExceptionx - An array containing the primal starting values for the
variables specified in var.var - An array containing the variables for which to specify
primal starting values.xstart - The first element in x and var
to be used.xnum - The number of consecutive elements in x and
var to be used.pi - An array containing the dual starting values for the
constraints specified in rng.rng - An array containing the constraints for which to specify
dual starting values.cstart - The first element in pi and rng
to be used.cnum - The number of consecutive elements in pi and
rng to be used.