30.01.2015 Views

ILOG CPLEX C++ API 9.0 Reference Manual

ILOG CPLEX C++ API 9.0 Reference Manual

ILOG CPLEX C++ API 9.0 Reference Manual

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

ILOPROBINGCALLBACK0<br />

ILOPROBINGCALLBACK0<br />

Category<br />

Synopsis<br />

Description<br />

Macro<br />

ILOPROBINGCALLBACK0(name)<br />

ILOPROBINGCALLBACK1(name, type1, x1)<br />

ILOPROBINGCALLBACK2(name, type1, x1, type2, x2)<br />

ILOPROBINGCALLBACK3(name, type1, x1, type2, x2, type3, x3)<br />

ILOPROBINGCALLBACK4(name, type1, x1, type2, x2, type3, x3, type4, x4)<br />

ILOPROBINGCALLBACK5(name, type1, x1, type2, x2, type3, x3, type4, x4, type5,<br />

x5)<br />

ILOPROBINGCALLBACK6(name, type1, x1, type2, x2, type3, x3, type4, x4, type5,<br />

x5, type6, x6)<br />

ILOPROBINGCALLBACK7(name, type1, x1, type2, x2, type3, x3, type4, x4, type5,<br />

x5, type6, x6, type7, x7)<br />

This macro creates two things: an implementation class for a user-defined callback<br />

named nameI and a function named name that creates an instance of this class and<br />

returns a handle for it, that is, an instance of IloCplex::Callback. This function<br />

needs to be called with an environment as its first parameter, followed by the n<br />

parameters specified at the macro execution in order to create a callback. You can then<br />

use the callback by passing it to the use method of an IloCplex object.<br />

The class nameI that is created by the macro includes the implementation of the<br />

method duplicateCallback as required for callbacks. The implementation of the<br />

main method must be provided by the user in curly brackets following the macro<br />

invocation, like this:<br />

ILOPROBINGCALLBACKn(name, ...) {<br />

// implementation of the callback<br />

}<br />

For the implementation of the callback, methods from class<br />

IloCplex::ProbingCallbackI and its parent classes can be used.<br />

You are not obliged to use this macro to define callbacks. When the macro seems too<br />

restrictive for your purposes, we recommend that you define a callback class directly.<br />

Since the argument name is used to name the callback class, it is not possible to use the<br />

same name for several callback definitions.<br />

See Also<br />

IloCplex::ProbingCallbackI<br />

<strong>ILOG</strong> <strong>CPLEX</strong> <strong>C++</strong> <strong>API</strong> <strong>9.0</strong> REFERENCE M ANUAL 34

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!