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
ILOG CPLEX User's Manual for more information about cuts.
This class also provides a common application programming interface (API) for these subclasses:
IloCplex.DisjunctiveCutCallbackIloCplex.FractionalCutCallbackIloCplex.FlowMIRCutCallbackIloCplex.ProbingCallbackIloCplex.IncumbentCallbackIloCplex.NodeCallbackIloCplex.SolveCallbackIloCplex.ControlCallback with its extensions:
IloCplex.BranchCallbackIloCplex.HeuristicCallback
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.
|
| Modifier | Constructor and Description |
|---|---|
protected |
IloCplex.MIPCallback()
Constructor for user-written MIP callback.
|
| Modifier and Type | Method and Description |
|---|---|
protected double |
getObjCoef(IloNumVar var)
Returns the linear objective function coefficient for 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[] var,
int start,
int num)
Returns the linear objective function coefficients for a set of variables in
the model being solved.
|
protected int |
getUserThreads() |
getBestObjValue, 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.MIPCallback()
IloCplex.MIPCallback objects directly.protected int getUserThreads()
throws IloException
IloExceptionprotected 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
vars[j].protected double[] getObjCoefs(IloNumVar[] var, int start, int num) throws IloException
IloExceptionvar - 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 variables in vars for which to query
the linear objective function coefficients.obj is the returned array, obj[j] is the
linear objective function coefficient for variable
vars[j+start], for j = 0, ..., num-1.