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

Class to define ABS2 callback function for factorization. More...

Inheritance diagram for qbpp::factorization::ABS2Callback:
Inheritance graph
[legend]
Collaboration diagram for qbpp::factorization::ABS2Callback:
Collaboration graph
[legend]

Public Member Functions

 ABS2Callback (const qbpp_abs2::QuadModel &quad_model, std::shared_ptr< SolHolder > sol_holder_ptr)
 Construct a new ABS2Callback object for factorization. More...
 
void callback (const std::string &event) override
 The default callback function for ABS2 QUBO solver. More...
 
Sol get_sol () const
 Get the solution from the ABS2 solver. More...
 
void set_hint (const Sol &hint)
 Provide a hint solution to the ABS2 solver. More...
 
void set (const std::string &operation)
 Set the operation to the ABS2 Callback. More...
 
void set (const std::string &operation, const std::string &operand)
 Set the operation and operand to the ABS2 Callback. More...
 
void set (const Sol &hint)
 Provide a hint solution to the ABS2 solver. More...
 
const Solget () const
 Get the current solution. More...
 

Protected Attributes

const QuadModel quad_model
 QuadModel object created by QUBO++ library. More...
 

Private Attributes

const std::shared_ptr< SolHoldersol_holder_ptr_
 The solution holder. More...
 
std::shared_ptr< Impl > pimpl
 

Detailed Description

Class to define ABS2 callback function for factorization.

Definition at line 201 of file factorization.cpp.

Constructor & Destructor Documentation

◆ ABS2Callback()

qbpp::factorization::ABS2Callback::ABS2Callback ( const qbpp_abs2::QuadModel quad_model,
std::shared_ptr< SolHolder sol_holder_ptr 
)
inline

Construct a new ABS2Callback object for factorization.

Parameters
quad_modelThe ABS2 quad_model.
sol_holder_ptrThe pointer to the solution holder given to the ABS2Callback.

Definition at line 211 of file factorization.cpp.

Member Function Documentation

◆ callback()

void qbpp::factorization::ABS2Callback::callback ( const std::string &  event)
inlineoverridevirtual

The default callback function for ABS2 QUBO solver.

This function is called by ABS2 QUBO solver when an event occurs.

Parameters
eventEvent type specfied by ABS2 QUBO solver
Note
This is a default callback function that displays the TTS and the energy when a new best solution is obtained. This function can be customized by overriding it.

Reimplemented from qbpp_abs2::Callback.

Definition at line 215 of file factorization.cpp.

Here is the call graph for this function:

◆ set() [1/3]

void abs2::Callback::set ( const std::string &  operation)
inherited

Set the operation to the ABS2 Callback.

Parameters
operationOperation string

Set the operation to the ABS2 Callback.

Here is the caller graph for this function:

◆ set() [2/3]

void abs2::Callback::set ( const std::string &  operation,
const std::string &  operand 
)
inherited

Set the operation and operand to the ABS2 Callback.

Parameters
operationOperation string
operandOperand string

Set the operation and operand to the ABS2 Callback.

◆ set() [3/3]

void abs2::Callback::set ( const Sol hint)
inherited

Provide a hint solution to the ABS2 solver.

Parameters
hintHint solution

Provide a hint solution will be used by the ABS2 solver to improve the solution.

◆ get()

const Sol& abs2::Callback::get ( ) const
inherited

Get the current solution.

Here is the caller graph for this function:

Member Data Documentation

◆ sol_holder_ptr_

const std::shared_ptr<SolHolder> qbpp::factorization::ABS2Callback::sol_holder_ptr_
private

The solution holder.

Definition at line 204 of file factorization.cpp.

◆ quad_model

const QuadModel qbpp_abs2::Callback::quad_model
protectedinherited

QuadModel object created by QUBO++ library.

Definition at line 207 of file qbpp_abs2.hpp.

◆ pimpl

std::shared_ptr<Impl> abs2::Callback::pimpl
privateinherited

Definition at line 288 of file abs2.hpp.


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