QUBO++ Library with QUBO Solver APIs
Author: Koji Nakano, License: Non-commercial research and evaluation purposes without any guarantees.
|
Class to store a QUBO model using Gurobi Optimizer through QUBO++ library. More...
#include <qbpp_grb.hpp>
Public Member Functions | |
QuadModel (const qbpp::QuadModel &quad_model, bool verbose=false) | |
Constructor to create a model from QuadModel object. More... | |
QuadModel (const QuadModel &grb_model)=default | |
Copy constructor to create a model from another model. More... | |
void | set (const std::string &key, const std::string &val) |
Sets a parameter to the Gurobi environment. More... | |
void | set_time_limit (uint32_t time_limit) |
Sets time limit to the Gurobi model. More... | |
void | set (Callback &cb) |
Set a callback function to the Gurobi model. More... | |
GRBVar | get_grb_var (int index) const |
Get the Gurobi variable from the index. More... | |
GRBModel & | get_grb_model () |
Get the Gurobi model. More... | |
const GRBModel & | get_grb_model () const |
Get the Gurobi model. More... | |
void | write (std::string filename) |
Write the model to a file. More... | |
const std::vector< coeff_t > & | get_linear () const |
coeff_t | get_linear (vindex_t index) const |
const std::vector< vindex_t > & | get_degree () const |
vindex_t | get_degree (vindex_t index) const |
const std::vector< std::vector< std::pair< vindex_t, coeff_t > > > & | get_quadratic () const |
std::pair< vindex_t, coeff_t > | get_quadratic (vindex_t i, vindex_t j) const |
size_t | term_count (vindex_t deg) const |
size_t | term_count () const override |
coeff_t | get_min_coeff () const |
coeff_t | get_max_coeff () const |
vindex_t | var_count () const |
Var | get_var (vindex_t index) const |
vindex_t | get_index (Var var) const |
bool | has (Var var) const |
const Expr & | get_expr () const |
operator const Expr & () const | |
energy_t | get_constant () const |
const Terms & | get_terms () const |
std::vector< Var > | get_index_var () const |
Sol | optimize () |
Optimize the QUBO model. More... | |
Static Protected Member Functions | |
static const Expr & | check_expr (const Expr &expr) |
static Expr | check_expr (Expr &&expr) |
Protected Attributes | |
GRBEnv | grb_env |
Gurobi environment. More... | |
std::shared_ptr< GRBModel > | grb_model_ptr |
Gurobi model. More... | |
GRBVar * | grb_x |
Pointer to Gurobi variables. More... | |
const std::shared_ptr< const Expr > | expr_ptr_ |
const std::shared_ptr< const impl::IndexVarMapper > | index_var_ptr_ |
Private Attributes | |
const std::shared_ptr< const Impl > | pimpl_ |
const std::vector< coeff_t > & | linear_ |
const std::vector< vindex_t > & | degree_ |
const std::vector< std::vector< std::pair< vindex_t, coeff_t > > > & | quadratic_ |
Class to store a QUBO model using Gurobi Optimizer through QUBO++ library.
This class is used to store a QUBO model and solve it using Gurobi Optimizer through QUBO++ library.
Definition at line 42 of file qbpp_grb.hpp.
|
inline |
Get the Gurobi variable from the index.
index | index of the variable from 0 to size()-1 |
Definition at line 92 of file qbpp_grb.hpp.
|
inline |
|
inline |
|
inline |
Optimize the QUBO model.
Definition at line 260 of file qbpp_grb.hpp.
|
inline |
Write the model to a file.
filename | File name |
The model is written in the LP format. The format type is determined by the file extension such as .lp and .mps.
Definition at line 112 of file qbpp_grb.hpp.
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineoverridevirtualinherited |
Reimplemented from qbpp::Model.
Definition at line 1268 of file qbpp.hpp.
|
inlineinherited |
|
inlineinherited |
|
inlinestaticprotectedinherited |
|
inlinestaticprotectedinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
protected |
Gurobi environment.
Definition at line 45 of file qbpp_grb.hpp.
|
protected |
Gurobi model.
Definition at line 47 of file qbpp_grb.hpp.
|
protected |
Pointer to Gurobi variables.
Definition at line 49 of file qbpp_grb.hpp.
|
privateinherited |
|
privateinherited |
|
privateinherited |
|
privateinherited |
|
protectedinherited |
|
protectedinherited |