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

Class to manage callback function for ABS2 QUBO solver. More...

#include <abs2.hpp>

Inheritance diagram for abs2::Callback:
Inheritance graph
[legend]

Public Member Functions

 Callback ()
 Constructor for creating a callback object. More...
 
virtual ~Callback ()=default
 Destructor for deleting a callback object. More...
 
virtual void callback (const std::string &event)=0
 Callback function must be defined by user. 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...
 

Private Attributes

std::shared_ptr< Impl > pimpl
 

Detailed Description

Class to manage callback function for ABS2 QUBO solver.

Definition at line 258 of file abs2.hpp.

Constructor & Destructor Documentation

◆ Callback()

abs2::Callback::Callback ( )

Constructor for creating a callback object.

◆ ~Callback()

virtual abs2::Callback::~Callback ( )
virtualdefault

Destructor for deleting a callback object.

Note
Do not delete the callback object.

Reimplemented in qbpp_abs2::Callback.

Member Function Documentation

◆ callback()

virtual void abs2::Callback::callback ( const std::string &  event)
pure virtual

Callback function must be defined by user.

Parameters
eventEvent string

The callback function must be defined by the user.

Implemented in ABS2Callback, qbpp::factorization::ABS2Callback, and qbpp_abs2::Callback.

◆ set() [1/3]

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

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 
)

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)

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

Get the current solution.

Here is the caller graph for this function:

Member Data Documentation

◆ pimpl

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

Definition at line 288 of file abs2.hpp.


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