Skip to main content
FRAMES NO FRAMES

Class IloCplex::ContinuousCallbackI

Definition file: ilcplex/ilocplexi.h
Map of IloCplex::ContinuousCallbackIIloCplex::ContinuousCallbackIIloCplex::BarrierCallbackIIloCplex::SimplexCallbackIIloCplex::ContinuousCallbackIIloCplex::OptimizationCallbackIIloCplex::CallbackI

An instance of a class derived from IloCplex::ContinuousCallbackI represents a user-written callback in a CPLEX application that uses an instance of IloCplex with the primal simplex, dual simplex, or barrier optimizer. IloCplex calls the user-written callback after each iteration during an optimization of a problem solved at a node.

In the case of concurrent optimization, CPLEX calls the user-written callback only in the main thread, not in other concurrent threads.

This class offers methods for use within the callbacks you write. In particular, there are methods in this class to access primal and dual feasibility, number of iterations, and objective value.

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.

Note

There are special callbacks for simplex and barrier, that is, IloCplex::SimplexCallbackI and IloCplex::BarrierCallbackI, respectively. Using a continuous callback sets this callback in both of these algorithms. If a special callback was already set for one of these algorithms, (for example, simplex) it is replaced by the general continuous callback.

See Also:

Method Summary
protected ContinuousCallbackI(IloEnv env)
public IloNumgetDualInfeasibility() const
public IloNumgetInfeasibility() const
public IloIntgetNiterations() const
public IloInt64getNiterations64() const
public IloNumgetObjValue() const
protected Callback::TypegetType() const
public IloBoolisDualFeasible() const
public IloBoolisFeasible() const
Inherited Methods from OptimizationCallbackI
getModel, getNcols, getNQCs, getNrows
Inherited Methods from CallbackI
abort, duplicateCallback, getCplexTime, getDetTime, getEndDetTime, getEndTime, getEnv, getStartDetTime, getStartTime, getType, main
Method Detail

ContinuousCallbackI

protected ContinuousCallbackI(IloEnv env)

This constructor creates a callback for use in an application that solves continuous models.


getDualInfeasibility

public IloNum getDualInfeasibility() const

This method returns the current dual infeasibility measure of the solution in the instance of IloCplex at the time the invoking callback is executed.


getInfeasibility

public IloNum getInfeasibility() const

This method returns the current primal infeasibility measure of the solution in the instance of IloCplex at the time the invoking callback is executed.


getNiterations

public IloInt getNiterations() const

This method returns the number of iterations completed so far by an instance of IloCplex at the invoking callback is executed.


getNiterations64

public IloInt64 getNiterations64() const

This method returns the number of iterations completed so far by an instance of IloCplex at the invoking callback is executed.


getObjValue

public IloNum getObjValue() const

This method returns the current objective value of the solution in the instance of IloCplex at the time the invoking callback is executed.

If you need the object representing the objective itself, consider the method IloCplex::getObjective instead.


isDualFeasible

public IloBool isDualFeasible() const

This method returns IloTrue if the current solution is dual feasible.


isFeasible

public IloBool isFeasible() const

This method returns IloTrue if the current solution is primal feasible.


getType

protected Callback::Type getType() const

This method returns the callback type of the invoking callback object.