Class to define Gurobi callback function for factorization.
More...
Class to define Gurobi callback function for factorization.
- Note
- This Gurobi callback inherits from qbpp_grb::Callback.
Definition at line 18 of file tsp_grb.cpp.
◆ GRB_Callback()
Construct a new grb callback object.
- Parameters
-
tsp_quad_model | The TSP expression. |
target_energy | The target energy. |
Definition at line 26 of file tsp_grb.cpp.
◆ callback()
void GRB_Callback::callback |
( |
| ) |
|
|
inlineoverridevirtual |
callback function for Gurobi optimizer.
The callback function is called by the Gurobi optimizer for every event. It displays the solution of the TSP when a new best solution obtained.
Reimplemented from qbpp_grb::Callback.
Definition at line 36 of file tsp_grb.cpp.
◆ get_sol()
Sol qbpp_grb::Callback::get_sol |
( |
| ) |
|
|
inlineinherited |
Get the solution obtained by Gurobi Optimizer.
- Returns
- Solution by Gurobi Optimizer
Definition at line 274 of file qbpp_grb.hpp.
◆ set_target_energy()
void qbpp_grb::Callback::set_target_energy |
( |
qbpp::energy_t |
target_energy | ) |
|
|
inlineinherited |
Set the target energy for Gurobi Optimizer.
Definition at line 194 of file qbpp_grb.hpp.
◆ abort_if_target_energy()
void qbpp_grb::Callback::abort_if_target_energy |
( |
qbpp::energy_t |
energy | ) |
|
|
inlineinherited |
Abort the optimization process if the target energy is achieved.
- Parameters
-
energy | Energy of the current solution |
This function is intended to be called in callback() function.
Definition at line 201 of file qbpp_grb.hpp.
◆ getDoubleInfoPublic()
double qbpp_grb::Callback::getDoubleInfoPublic |
( |
int |
what | ) |
|
|
inlineinherited |
Calls GetDoubleInfo() of GRBCallback.
- Parameters
-
- Returns
- double value
Definition at line 210 of file qbpp_grb.hpp.
◆ getSolutionPublic()
double qbpp_grb::Callback::getSolutionPublic |
( |
GRBVar |
v | ) |
|
|
inlineinherited |
Calls getSolution() of GRBCallback.
- Parameters
-
- Returns
- double value
Definition at line 215 of file qbpp_grb.hpp.
◆ tsp_quad_model
◆ target_energy
◆ quad_model
const QuadModel qbpp_grb::Callback::quad_model |
|
protectedinherited |
◆ grb_model
const GRBModel& qbpp_grb::Callback::grb_model |
|
protectedinherited |
Shortcut to the GRBModel in QuadModel.
Definition at line 155 of file qbpp_grb.hpp.
◆ mtx
std::mutex qbpp_grb::Callback::mtx |
|
mutableprotectedinherited |
The documentation for this class was generated from the following file: