|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ilog.cplex.IloCplex.Callback | +--ilog.cplex.IloCplex.MIPCallback | +--ilog.cplex.IloCplex.SolveCallback
The base class for user-written solve callbacks to control how node relaxations are solved within branch and cut.
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.MIPCallback
Constructor Summary | |
protected |
IloCplex.SolveCallback()
Constructor for user-written solve callback. |
Method Summary | |
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 |
setVectors(double[] x,
ilog.concert.IloNumVar[] var,
double[] pi,
ilog.concert.IloRange[] rng)
Specifies a starting point for the next invocation of method solve . |
protected void |
setVectors(double[] x,
ilog.concert.IloNumVar[] var,
int xstart,
int xnum,
double[] pi,
ilog.concert.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. |
Methods inherited from class ilog.cplex.IloCplex.Callback |
abort, getModel, getNcols, getNQCs, getNrows, main |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
protected IloCplex.SolveCallback()
IloCplex.SolveCallback
objects directly.
Method Detail |
protected boolean solve(int alg) throws IloException
alg
.
See IloCplex.Algorithm
for a choice
of algorithms to use.
alg
- The IloCplex.Algorithm
to use to solve the
current node.
IloException
protected boolean solve() throws IloException
IloCplex.Algorithm.Auto
).
IloException
protected IloCplex.Status getStatus() throws IloException
solve
call.
solve
call.
IloException
protected IloCplex.CplexStatus getCplexStatus() throws IloException
IloCplex.CplexStatus
of the last
solve
call.
IloCplex.CplexStatus
of the last
solve
call.
IloException
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.
IloException
public 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.
IloException
protected 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 setVectors(double[] x, ilog.concert.IloNumVar[] var, double[] pi, ilog.concert.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]
.
x
- 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.
IloException
protected void setVectors(double[] x, ilog.concert.IloNumVar[] var, int xstart, int xnum, double[] pi, ilog.concert.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]
.
x
- 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.
IloException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |