Register or clear a callback to be invoked by CPLEX during optimization.

Namespace: ILOG.CPLEX
Assembly: ILOG.CPLEX (in ILOG.CPLEX.dll) Version: 22.1.1.0

Syntax

C#
public virtual void Use(
	Cplex..::..Callback..::..Function callback,
	long contextMask
)
Visual Basic
Public Overridable Sub Use ( _
	callback As Cplex..::..Callback..::..Function, _
	contextMask As Long _
)

Parameters

callback
Type: ILOG.CPLEX..::..Cplex..::..Callback..::..Function
The new callback to be set or null to clear the callback.
contextMask
Type: System..::..Int64
A bitmask that specifies in which contexts to invoke the callback or 0 (zero) to clear the callback.

Remarks

Call this with callback = null or contextMask = 0 to clear the current callback. To register a callback invoke this method with callback argument different from null and a contextMask different from 0 (zero). The value of contextMask can be the bitwise OR of values from Callback.Context.Id. Note: The function will always clear any current callback, even if setting the new callback fails. Thus at most one callback can be registered with a single instance of Cplex. Throws ILOG.Concert.Exception if an error occurs.

See Also