QUBO++ Library with QUBO Solver APIs
Author: Koji Nakano, License: Non-commercial research and evaluation purposes without any guarantees.
Public Member Functions | Static Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
qbpp_abs2::QuadModel Class Reference

A class for storing both the qbpp::QuadModel and abs2::Model. More...

#include <qbpp_abs2.hpp>

Inheritance diagram for qbpp_abs2::QuadModel:
Inheritance graph
[legend]
Collaboration diagram for qbpp_abs2::QuadModel:
Collaboration graph
[legend]

Public Member Functions

 QuadModel (const qbpp::QuadModel &quad_model)
 Constructor: Create an ABS2 model from a QUBO model. More...
 
 QuadModel (const QuadModel &quad_model)
 Copy constructor. More...
 
const abs2::Modelget_abs2_model () const
 Get the ABS2 model. 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
 

Static Protected Member Functions

static const Expr & check_expr (const Expr &expr)
 
static Expr check_expr (Expr &&expr)
 

Protected Attributes

const std::shared_ptr< const Expr > expr_ptr_
 
const std::shared_ptr< const impl::IndexVarMapper > index_var_ptr_
 

Private Member Functions

 QuadModel ()=delete
 Default constructor is deleted to avoid creating an empty model. More...
 

Private Attributes

std::shared_ptr< abs2::Modelabs2model_ptr
 ABS2 model associated with the QUBO model. More...
 
const std::shared_ptr< const Implpimpl_
 
const std::vector< coeff_t > & linear_
 
const std::vector< vindex_t > & degree_
 
const std::vector< std::vector< std::pair< vindex_t, coeff_t > > > & quadratic_
 

Detailed Description

A class for storing both the qbpp::QuadModel and abs2::Model.

This class is derived from qbpp::QuadModel and containing an abs2::Model object.

Definition at line 76 of file qbpp_abs2.hpp.

Constructor & Destructor Documentation

◆ QuadModel() [1/2]

qbpp_abs2::QuadModel::QuadModel ( )
privatedelete

Default constructor is deleted to avoid creating an empty model.

◆ QuadModel() [2/2]

qbpp_abs2::QuadModel::QuadModel ( const QuadModel quad_model)
inline

Copy constructor.

Parameters
quad_modelQuadModel object

Definition at line 90 of file qbpp_abs2.hpp.

Member Function Documentation

◆ get_abs2_model()

const abs2::Model& qbpp_abs2::QuadModel::get_abs2_model ( ) const
inline

Get the ABS2 model.

Returns
ABS2 model

Definition at line 95 of file qbpp_abs2.hpp.

Here is the caller graph for this function:

◆ get_linear() [1/2]

const std::vector<coeff_t>& qbpp::QuadModel::get_linear ( ) const
inlineinherited

Definition at line 1241 of file qbpp.hpp.

Here is the caller graph for this function:

◆ get_linear() [2/2]

coeff_t qbpp::QuadModel::get_linear ( vindex_t  index) const
inlineinherited

Definition at line 1250 of file qbpp.hpp.

◆ get_degree() [1/2]

const std::vector<vindex_t>& qbpp::QuadModel::get_degree ( ) const
inlineinherited

Definition at line 1243 of file qbpp.hpp.

Here is the caller graph for this function:

◆ get_degree() [2/2]

vindex_t qbpp::QuadModel::get_degree ( vindex_t  index) const
inlineinherited

Definition at line 1252 of file qbpp.hpp.

◆ get_quadratic() [1/2]

const std::vector<std::vector<std::pair<vindex_t, coeff_t> > >& qbpp::QuadModel::get_quadratic ( ) const
inlineinherited

Definition at line 1245 of file qbpp.hpp.

Here is the caller graph for this function:

◆ get_quadratic() [2/2]

std::pair<vindex_t, coeff_t> qbpp::QuadModel::get_quadratic ( vindex_t  i,
vindex_t  j 
) const
inlineinherited

Definition at line 1254 of file qbpp.hpp.

◆ term_count() [1/2]

size_t qbpp::QuadModel::term_count ( vindex_t  deg) const
inlineinherited

Definition at line 1258 of file qbpp.hpp.

Here is the caller graph for this function:

◆ term_count() [2/2]

size_t qbpp::QuadModel::term_count ( ) const
inlineoverridevirtualinherited

Reimplemented from qbpp::Model.

Definition at line 1268 of file qbpp.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_min_coeff()

coeff_t qbpp::QuadModel::get_min_coeff ( ) const
inlineinherited

Definition at line 1270 of file qbpp.hpp.

Here is the caller graph for this function:

◆ get_max_coeff()

coeff_t qbpp::QuadModel::get_max_coeff ( ) const
inlineinherited

Definition at line 1272 of file qbpp.hpp.

Here is the caller graph for this function:

◆ check_expr() [1/2]

static const Expr& qbpp::Model::check_expr ( const Expr expr)
inlinestaticprotectedinherited

Definition at line 1111 of file qbpp.hpp.

Here is the call graph for this function:

◆ check_expr() [2/2]

static Expr qbpp::Model::check_expr ( Expr &&  expr)
inlinestaticprotectedinherited

Definition at line 1120 of file qbpp.hpp.

Here is the call graph for this function:

◆ var_count()

vindex_t qbpp::Model::var_count ( ) const
inlineinherited

Definition at line 1154 of file qbpp.hpp.

Here is the caller graph for this function:

◆ get_var()

Var qbpp::Model::get_var ( vindex_t  index) const
inlineinherited

Definition at line 1156 of file qbpp.hpp.

Here is the caller graph for this function:

◆ get_index()

vindex_t qbpp::Model::get_index ( Var  var) const
inlineinherited

Definition at line 1158 of file qbpp.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ has()

bool qbpp::Model::has ( Var  var) const
inlineinherited

Definition at line 1160 of file qbpp.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_expr()

const Expr& qbpp::Model::get_expr ( ) const
inlineinherited

Definition at line 1164 of file qbpp.hpp.

Here is the caller graph for this function:

◆ operator const Expr &()

qbpp::Model::operator const Expr & ( ) const
inlineinherited

Definition at line 1166 of file qbpp.hpp.

◆ get_constant()

energy_t qbpp::Model::get_constant ( ) const
inlineinherited

Definition at line 1168 of file qbpp.hpp.

Here is the caller graph for this function:

◆ get_terms()

const Terms& qbpp::Model::get_terms ( ) const
inlineinherited

Definition at line 1170 of file qbpp.hpp.

◆ get_index_var()

std::vector<Var> qbpp::Model::get_index_var ( ) const
inlineinherited

Definition at line 1172 of file qbpp.hpp.

Here is the caller graph for this function:

Member Data Documentation

◆ abs2model_ptr

std::shared_ptr<abs2::Model> qbpp_abs2::QuadModel::abs2model_ptr
private

ABS2 model associated with the QUBO model.

Definition at line 78 of file qbpp_abs2.hpp.

◆ pimpl_

const std::shared_ptr<const Impl> qbpp::QuadModel::pimpl_
privateinherited

Definition at line 1195 of file qbpp.hpp.

◆ linear_

const std::vector<coeff_t>& qbpp::QuadModel::linear_
privateinherited

Definition at line 1197 of file qbpp.hpp.

◆ degree_

const std::vector<vindex_t>& qbpp::QuadModel::degree_
privateinherited

Definition at line 1199 of file qbpp.hpp.

◆ quadratic_

const std::vector<std::vector<std::pair<vindex_t, coeff_t> > >& qbpp::QuadModel::quadratic_
privateinherited

Definition at line 1201 of file qbpp.hpp.

◆ expr_ptr_

const std::shared_ptr<const Expr> qbpp::Model::expr_ptr_
protectedinherited

Definition at line 1107 of file qbpp.hpp.

◆ index_var_ptr_

const std::shared_ptr<const impl::IndexVarMapper> qbpp::Model::index_var_ptr_
protectedinherited

Definition at line 1109 of file qbpp.hpp.


The documentation for this class was generated from the following file: