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.

ILOMIPCALLBACK0<br />

ILOMIPCALLBACK0<br />

Category<br />

Synopsis<br />

Description<br />

Macro<br />

ILOMIPCALLBACK0(name)<br />

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

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

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

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

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

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

type6, x6)<br />

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

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 />

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

// implementation of the callback<br />

}<br />

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

IloCplex::MIPCallbackI 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::MIPCallbackI<br />

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

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

Saved successfully!

Ooh no, something went wrong!