| Overview | Group | Tree | Graph | Deprecated | Index | Concepts |
This macro creates two things: an implementation class for a user-defined
lazy constraint callback named nameI and a function named
name that creates an instance of this class and returns an
IloCplex::Callback handle for it. This function needs to be
called with an environment as first parameter followed by the n parameters
specified at the macro execution in order to create a callback.
You can then use the callback
by passing it to the use method of an
IloCplex object.
The class nameI that is created by the macro includes the
implementation of method duplicateCallback
as required for callbacks.
The implementation of the main method must be provided
in curly brackets {} by the user and must follow the macro invocation,
like this:
ILOLAZYCONSTRAINTCALLBACKn(name, ...) {
// implementation of the callback
}For the implementation of the callback, methods from the class
IloCplex::LazyConstraintCallbackI and its parent classes can be
used.
You are not obliged to use this macro to define callbacks. When the macro seems too restrictive for your purposes, you can define a callback class directly. Since the argument name is used to name the callback class, it is not possible to use the same name for several callback definitions.
See Also: