NO FRAMES

Class IloCplex::SolveCallbackI

Definition file: ilcplex/ilocplexi.h
Note

This is an advanced class. Advanced classes typically demand a profound understanding of the algorithms used by ILOG CPLEX. Thus they incur a higher risk of incorrect behavior in your application, behavior that can be difficult to debug. Therefore, ILOG encourages you to consider carefully whether you can accomplish the same task by means of other classes instead.

An instance of the class IloCplex::SolveCallbackI can be used to solve node relaxations during branch & cut search. It allows you to set a starting point for the solve or to select the algorithm on a per-node basis.

The methods of this class are protected for use in deriving a user-written callback class and in implementing the main method there.

If an attempt is made to access information not available to an instance of this class, an exception is thrown.

See Also:

Constructor Summary
protected SolveCallbackI(IloEnv env)
Method Summary
protected IloCplex::CplexStatusgetCplexStatus() const
protected IloAlgorithm::StatusgetStatus() const
protected IloBoolisDualFeasible() const
protected IloBoolisPrimalFeasible() const
protected voidsetVectors(const IloNumArray x, const IloIntVarArray var, const IloNumArray pi, const IloRangeArray rng)
protected voidsetVectors(const IloNumArray x, const IloNumVarArray var, const IloNumArray pi, const IloRangeArray rng)
protected IloBoolsolve(IloCplex::Algorithm alg=Dual)
protected voiduseSolution()
Inherited Methods from ControlCallbackI
getDownPseudoCost, getDownPseudoCost, getFeasibilities, getFeasibilities, getFeasibility, getFeasibility, getFeasibility, getFeasibility, getLB, getLB, getLBs, getLBs, getNodeData, getObjValue, getSlack, getSlacks, getUB, getUB, getUBs, getUBs, getUpPseudoCost, getUpPseudoCost, getValue, getValue, getValue, getValues, getValues, isSOSFeasible, isSOSFeasible
Inherited Methods from MIPCallbackI
getNcliques, getNcovers, getNdisjunctiveCuts, getNflowCovers, getNflowPaths, getNfractionalCuts, getNGUBcovers, getNimpliedBounds, getNMIRs, getObjCoef, getObjCoef, getObjCoefs, getObjCoefs, getUserThreads
Inherited Methods from MIPInfoCallbackI
getBestObjValue, getCutoff, getDirection, getDirection, getIncumbentObjValue, getIncumbentSlack, getIncumbentSlacks, getIncumbentValue, getIncumbentValue, getIncumbentValues, getIncumbentValues, getMyThreadNum, getNiterations, getNnodes, getNremainingNodes, getPriority, getPriority, hasIncumbent
Inherited Methods from OptimizationCallbackI
getModel, getNcols, getNQCs, getNrows
Inherited Methods from CallbackI
abort, duplicateCallback, getEnv, main
Constructor Detail

SolveCallbackI

protected SolveCallbackI(IloEnv env)

This constructor creates a callback for use in an application for solving the node LPs during branch & cut searches.


Method Detail

getCplexStatus

protected IloCplex::CplexStatus getCplexStatus() const

This method returns the ILOG CPLEX status of the instance of IloCplex at the current node (that is, the state of the optimizer at the node) during the last call to SolveCallbackI::solve (which may have been called directly in the callback or by IloCplex when processing the node).

The enumeration IloCplex::CplexStatus lists the possible status values.


getStatus

protected IloAlgorithm::Status getStatus() const

This method returns the status of the solution found by the instance of IloCplex at the current node during the last call to SolveCallbackI::solve (which may have been called directly in the callback or by IloCplex when processing the node).

The enumeration IloAlgorithm::Status lists the possible status values.


isDualFeasible

protected IloBool isDualFeasible() const

This method returns IloTrue if the solution provided by the last solve call is dual feasible. Note that an IloFalse return value does not necessarily mean that the solution is not dual feasible. It simply means that the relevant algorithm was not able to conclude it was dual feasible when it terminated.


isPrimalFeasible

protected IloBool isPrimalFeasible() const

This method returns IloTrue if the solution provided by the last solve call is primal feasible. Note that an IloFalse return value does not necessarily mean that the solution is not primal feasible. It simply means that the relevant algorithm was not able to conclude it was primal feasible when it terminated.


setVectors

protected void setVectors(const IloNumArray x, const IloIntVarArray var, const IloNumArray pi, const IloRangeArray rng)

This method allows a user to specify a starting point for the following invocation of the solve method in a solve callback. Zero can be passed for any of the parameters. However, if x is not zero, then var must not be zero either. Similarly, if pi is not zero, then rng must not be zero either.

For all variables in var, x[i] specifies the starting value for the variable var[i]. Similarly, for all ranged constraints specified in rng, pi[i] specifies the starting dual value for rng[i].

This information is exploited at the next call to solve, to construct a starting point for the algorithm.


setVectors

protected void setVectors(const IloNumArray x, const IloNumVarArray var, const IloNumArray pi, const IloRangeArray rng)

This method allows a user to specify a starting point for the following invocation of the solve method in a solve callback. Zero can be passed for any of the parameters. However, if x is not zero, then var must not be zero either. Similarly, if pi is not zero, then rng must not be zero either.

For all variables in var, x[i] specifies the starting value for the variable var[i]. Similarly, for all ranged constraints specified in rng, pi[i] specifies the starting dual value for rng[i].

This information is exploited at the next call to solve, to construct a starting point for the algorithm.


solve

protected IloBool solve(IloCplex::Algorithm alg=Dual)

This method uses the algorithm alg to solve the current node LP. See IloCplex::Algorithm for a choice of algorithms to use.


useSolution

protected void useSolution()

A call to this method instructs IloCplex to use the solution generated with this callback.

If useSolution is not called, IloCplex uses the algorithm selected with the parameters IloCplex::RootAlg for the solution of the root, or IloCplex::NodeAlg to solve the node.