public abstract static class IloCplex.SolveCallback extends IloCplex.ControlCallback
An instance of this class can be used to solve nodes 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.MIPCallbackIloCplex.MIPCallback.NodeData| 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 method
solve. |
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. |
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, getObjValue, getSlack, getSlacks, getSlacks, getSOSFeasibility, getSOSFeasibility, getUB, getUBs, getUBs, getUpPseudoCost, getValue, getValue, getValues, getValues, setNodeDatagetObjCoef, getObjCoefs, getObjCoefs, getUserThreadsgetBestObjValue, getCutoff, getDirection, getIncumbentObjValue, getIncumbentValue, getIncumbentValue, getIncumbentValues, getIncumbentValues, getMIPRelativeGap, getMyThreadNum, getNiterations, getNnodes, getNremainingNodes, getPriority, hasIncumbentabort, getCplexTime, getDetTime, getEndDetTime, getEndTime, getEnvImpl, getModel, getNcols, getNQCs, getNrows, 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 has not determined the feasibility before
it terminated.IloExceptionprotected void useSolution()
IloCplex to use a solution.
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 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.
Starting point information is exploited at the next call of method
solve. 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 method.
The starting point information is provided in the parameters of this method.
null can be passed for any of the parameters. However, if
x is not null, var must not be
null. Similarly, if pi is not null,
rng must not be null.
For all variables given in var, x[j] specifies the
starting primal value for variable var[j]. Similarly, for all
constraints specified in rng, pi[i] specifies the
starting dual value for rng[i].
IloExceptionx - The array of primal starting values for the variables specified in
var.var - The array of variables for which to specify primal starting
values.pi - The array of dual starting values for the constraints specified in
rng.rng - The array of constraints for which to specify dual starting
values.protected void setStart(double[] x,
IloNumVar[] var,
int xstart,
int xnum,
double[] pi,
IloRange[] rng,
int cstart,
int cnum)
throws IloException
solve.
Starting point information is exploited at the next call of
solve. 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 method.
The starting point information is provided in the parameters of this method.
null can be passed for any of the parameters. However, if
x is not null, var must not be
null. Similarly, if pi is not null,
rng must not be null.
x[j] specifies the starting primal value for variable
var[j]. Similarly, pi[i] specifies the starting
dual value for rng[i].
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 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 elements in pi and rng
to be used.