QUBO++ Library with QUBO Solver APIs
Author: Koji Nakano, License: Non-commercial research and evaluation purposes without any guarantees.
|
Class to define Gurobi callback function for factorization. More...
Public Member Functions | |
GRB_Callback (qbpp_grb::QuadModel &quad_model, std::shared_ptr< SolHolder > sol_holder_ptr) | |
Target energy to stop the Gurobi optimizer. std::optional<qbpp::energy_t> target_energy = std::nullopt;. More... | |
void | callback () override |
callback function for Gurobi optimizer. More... | |
Sol | get_sol () |
Get the solution obtained by Gurobi Optimizer. More... | |
void | set_target_energy (qbpp::energy_t target_energy) |
Set the target energy for Gurobi Optimizer. More... | |
void | abort_if_target_energy (qbpp::energy_t energy) |
Abort the optimization process if the target energy is achieved. More... | |
double | getDoubleInfoPublic (int what) |
Calls GetDoubleInfo() of GRBCallback. More... | |
double | getSolutionPublic (GRBVar v) |
Calls getSolution() of GRBCallback. More... | |
Protected Attributes | |
const QuadModel | quad_model |
QUBO model. More... | |
const GRBModel & | grb_model |
Shortcut to the GRBModel in QuadModel. More... | |
std::optional< qbpp::energy_t > | target_energy = std::nullopt |
Target energy to stop the Gurobi optimizer. More... | |
std::mutex | mtx |
Mutex to lock the critical section in get_sol() More... | |
Private Attributes | |
std::shared_ptr< SolHolder > | sol_holder_ptr_ |
The solution holder for Gurobi. More... | |
Class to define Gurobi callback function for factorization.
Definition at line 230 of file factorization.cpp.
|
inline |
Target energy to stop the Gurobi optimizer. std::optional<qbpp::energy_t> target_energy = std::nullopt;.
Construct a new grb callback object
quad_model | The Gurobi quad_model. |
sol_holder_ptr | The pinter to the solution holder given to the Gurobi Optimizer. |
Definition at line 242 of file factorization.cpp.
|
inlineoverridevirtual |
callback function for Gurobi optimizer.
The callback function is called by the Gurobi optimizer for every event.
Reimplemented from qbpp_grb::Callback.
Definition at line 249 of file factorization.cpp.
|
inlineinherited |
Get the solution obtained by Gurobi Optimizer.
Definition at line 274 of file qbpp_grb.hpp.
|
inlineinherited |
Set the target energy for Gurobi Optimizer.
Definition at line 194 of file qbpp_grb.hpp.
|
inlineinherited |
Abort the optimization process if the target energy is achieved.
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.
|
inlineinherited |
Calls GetDoubleInfo() of GRBCallback.
what | what to get |
Definition at line 210 of file qbpp_grb.hpp.
|
inlineinherited |
Calls getSolution() of GRBCallback.
v | Gurobi variable |
Definition at line 215 of file qbpp_grb.hpp.
|
private |
The solution holder for Gurobi.
Definition at line 233 of file factorization.cpp.
|
protectedinherited |
QUBO model.
Definition at line 152 of file qbpp_grb.hpp.
|
protectedinherited |
Shortcut to the GRBModel in QuadModel.
Definition at line 155 of file qbpp_grb.hpp.
|
protectedinherited |
Target energy to stop the Gurobi optimizer.
Definition at line 158 of file qbpp_grb.hpp.
|
mutableprotectedinherited |
Mutex to lock the critical section in get_sol()
Definition at line 164 of file qbpp_grb.hpp.