C++ Reference: class MPCallback

Note: This documentation is automatically generated.

Extend this class with model specific logic, and register through MPSolver::SetCallback, passing a pointer to this object.

See go/mpsolver-callbacks for additional documentation.
Method
might_add_cuts

Return type: bool

might_add_lazy_constraints

Return type: bool

MPCallback

Arguments: bool might_add_cuts, bool might_add_lazy_constraints

If you intend to call call MPCallbackContext::AddCut(), you must set might_add_cuts below to be true. Likewise for MPCallbackContext::AddLazyConstraint() and might_add_lazy_constraints.

~MPCallback

Return type: virtual

RunCallback

Return type: virtual void

Arguments: MPCallbackContext* callback_context

Threading behavior may be solver dependent: * Gurobi: RunCallback always runs on the same thread that you called MPSolver::Solve() on, even when Gurobi uses multiple threads.