14#ifndef OR_TOOLS_LINEAR_SOLVER_LINEAR_SOLVER_CALLBACK_H_
15#define OR_TOOLS_LINEAR_SOLVER_LINEAR_SOLVER_CALLBACK_H_
21#include "absl/container/flat_hash_map.h"
126 const absl::flat_hash_map<const MPVariable*, double>&
solution) = 0;
155 return might_add_lazy_constraints_;
159 bool might_add_cuts_;
160 bool might_add_lazy_constraints_;
167 explicit MPCallbackList(
const std::vector<MPCallback*>& callbacks);
173 const std::vector<MPCallback*> callbacks_;
virtual void AddLazyConstraint(const LinearRange &lazy_constraint)=0
virtual int64_t NumExploredNodes()=0
virtual double SuggestSolution(const absl::flat_hash_map< const MPVariable *, double > &solution)=0
virtual bool CanQueryVariableValues()=0
virtual MPCallbackEvent Event()=0
virtual ~MPCallbackContext()
virtual double VariableValue(const MPVariable *variable)=0
virtual void AddCut(const LinearRange &cutting_plane)=0
void RunCallback(MPCallbackContext *context) override
Runs all callbacks from the list given at construction, in sequence.
MPCallbackList(const std::vector< MPCallback * > &callbacks)
bool might_add_lazy_constraints() const
MPCallback(bool might_add_cuts, bool might_add_lazy_constraints)
bool might_add_cuts() const
virtual void RunCallback(MPCallbackContext *callback_context)=0
The class for variables of a Mathematical Programming (MP) model.
GurobiMPCallbackContext * context
In SWIG mode, we don't want anything besides these top-level includes.
@ kMultiObj
The solver is in multi-objective optimization.
@ kMipSolution
Called every time a new MIP incumbent is found.
@ kMessage
The solver is about to log out a message, use this callback to capture it.
@ kPresolve
The solver is currently running presolve.
@ kSimplex
The solver is currently running the simplex method.
@ kMipNode
Called once per pass of the cut loop inside each MIP node.
@ kBarrier
Called in each iterate of IPM/barrier method.
absl::string_view ToString(MPSolver::OptimizationProblemType optimization_problem_type)