public abstract static class IloCplex.MIPCallback extends IloCplex.MIPInfoCallback
An instance of the class MIPCallback 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 prior to solving
each node in the branch-and-cut search. This class allows you to
access an incumbent solution, an incumbent node, and an incumbent
objective value from a user-written callback. It also allows you to
access priority orders and statistical information, such as the number
of cuts that have been generated. Methods are also available to query
the number of generated cuts for each type of cut CPLEX generates.
See the CPLEX User's Manual for more information about
cuts.
This class also provides a common application programming interface (API) for these subclasses of control and query callbacks:
IloCplex.DisjunctiveCutCallbackIloCplex.FractionalCutCallbackIloCplex.FlowMIRCutCallbackIloCplex.ProbingCallbackIloCplex.IncumbentCallbackIloCplex.NodeCallbackIloCplex.SolveCallbackIloCplex.ControlCallback with its extensions:
IloCplex.BranchCallbackIloCplex.HeuristicCallbackIloCplex.UserCutCallbackIloCplex.LazyConstraintCallbackIloCplex.SolveCallback
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.Callback| Modifier and Type | Class and Description |
|---|---|
static interface |
IloCplex.MIPCallback.NodeData
Interface for user-objects attached to nodes.
|
IloCplex.Callback.Context, IloCplex.Callback.Function| Modifier | Constructor and Description |
|---|---|
protected |
IloCplex.MIPCallback()
Constructor for user-written MIP callback.
|
| Modifier and Type | Method and Description |
|---|---|
protected long |
getCurrentNodeDepth()
Returns the depth of the current node in the search tree.
|
protected double |
getNodeDoubleInfo(int which) |
protected int |
getNodeIntInfo(int which) |
protected long |
getNodeLongInfo(int which) |
protected double |
getObjCoef(IloNumVar var)
Returns the linear objective function coefficient for the variable
var in the model being solved. |
protected double[] |
getObjCoefs(IloNumVar[] vars)
Returns the linear objective function coefficients for an array of
variables in the model being solved.
|
protected double[] |
getObjCoefs(IloNumVar[] vars,
int start,
int num)
Returns the linear objective function coefficients for a set of
variables in the model being solved.
|
getBestObjValue, 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.MIPCallback()
IloCplex.MIPCallback objects directly.protected double getObjCoef(IloNumVar var) throws IloException
var in the model being solved.IloExceptionvar - The variable whose linear objective
coefficient is being queried.var in the model being solved.protected double[] getObjCoefs(IloNumVar[] vars) throws IloException
IloExceptionvars - An array of variables whose linear
objective function coefficients are being queried.obj, obj[j]
is the linear objective function coefficient for
variable var[j].protected double[] getObjCoefs(IloNumVar[] vars, int start, int num) throws IloException
IloExceptionvars - An array containing the variables whose linear
objective function coefficients are being queried.start - The index of the first variable in var for
which to query the linear objective function coefficients.num - The number of consecutive variables in var
for which to
query the linear objective function coefficients.obj
is the returned array, obj[j] is the
linear objective function coefficient for the variable
var[j+start], for
j = 0, ..., num-1.protected long getCurrentNodeDepth()
throws IloException
IloException - if invoked from a callback that is not in a node
context (for example NodeCallback)
or if an errors occurs during the query.protected int getNodeIntInfo(int which)
throws IloException
IloExceptionprotected long getNodeLongInfo(int which)
throws IloException
IloExceptionprotected double getNodeDoubleInfo(int which)
throws IloException
IloException