68 const Sol &start)
const;
179 void set(
int index,
bool value) {
237 if (event ==
"init") {
239 }
else if (event ==
"new") {
241 std::cout <<
"TTS = " << std::fixed << std::setprecision(3)
242 << sol.get_tts() <<
"s Energy=" << sol.get_energy()
282 param.
set(
"target_energy",
286 return Sol(quad_model,
292 const Sol &start)
const {
296 param.
set(
"target_energy",
300 return Sol(quad_model,
309 :
qbpp::
Sol(quad_model), abs2sol_ptr(std::make_shared<
abs2::
Sol>(sol)) {
317 :
qbpp::
Sol(sol), abs2sol_ptr(std::make_shared<
abs2::
Sol>(var_count())) {
API for the ABS2 GPU QUBO Solver.
Class to manage callback function for ABS2 QUBO solver.
void set(const std::string &operation)
Set the operation to the ABS2 Callback.
const Sol & get() const
Get the current solution.
Class to store and manipulate a QUBO model.
Class to store parameters for ABS2 QUBO solver.
void set(const std::string &key, const std::string &val)
Set "val" to "key".
Class to store a solution computed by ABS2 QUBO solver.
Class to configure the ABS2 QUBO solver.
energy_t get_constant() const
vindex_t var_count() const
coeff_t get_max_coeff() const
const std::vector< std::vector< std::pair< vindex_t, coeff_t > > > & get_quadratic() const
const std::vector< coeff_t > & get_linear() const
const std::vector< vindex_t > & get_degree() const
coeff_t get_min_coeff() const
vindex_t var_count() const
void set(vindex_t index, bool value)
vindex_t get_index(Var var) const
std::optional< energy_t > energy_
var_val_t get(vindex_t index) const
A class for defining the ABS2 callback function.
const QuadModel quad_model
QuadModel object created by QUBO++ library.
A class for setting parameters for the ABS2 QUBO solver.
std::optional< qbpp::energy_t > target_energy
The target energy given by C++ library.
A class for storing both the qbpp::QuadModel and abs2::Model.
std::shared_ptr< abs2::Model > abs2model_ptr
ABS2 model associated with the QUBO model.
const abs2::Model & get_abs2_model() const
Get the ABS2 model.
QuadModel()=delete
Default constructor is deleted to avoid creating an empty model.
QuadModel(const QuadModel &quad_model)
Copy constructor.
A class for storing the ABS2 QUBO solution.
void set(qbpp::Var var, bool value)
Set the value of the variable "var" to "value".
const std::shared_ptr< abs2::Sol > abs2sol_ptr
Sol object created by ABS2 QUBO solver.
void print(const std::string &attrs) const
print the solution
void set(int index, bool value)
Set the value of the variable with "index" to "value".
const std::shared_ptr< abs2::Sol > get_abs2sol_ptr() const
Returns the reference to the ABS2 solution.
Sol(const Sol &sol)=default
Copy constructor.
A class for calling the ABS2 QUBO solver.
Param()=default
Construct a new Param object from a QuadModel object.
void set_arithmetic_bits(uint32_t bits)
Set the arithmetic bits.
void set_time_limit(uint32_t time_limit)
Set the time limit for ABS2 QUBO solver.
Sol get_sol() const
Get the solution from the ABS2 solver.
virtual void callback(const std::string &event)
The default callback function for ABS2 QUBO solver.
Callback(const QuadModel &quad_model)
Construct a new Callback object.
std::optional< qbpp::energy_t > get_target_energy() const
Get the target energy for ABS2 QUBO solver.
Sol operator()(const QuadModel &quad_model, Param ¶m) const
Executes ABS2 for "quad_model" with "param" and returns "sol".
virtual ~Callback()=default
Destructor for deleting a callback object.
void set_target_energy(qbpp::energy_t target_energy)
Set the target energy for ABS2 QUBO solver.
void set_hint(const Sol &hint)
Provide a hint solution to the ABS2 solver.
Namespace to call ABS2 GPU QUBO solver.
Namespace to use ABS2 QUBO solver from QUBO++ library.
Generates a QUBO Expression for the Graph Coloring Problem using QUBO++ library.
Var var(const std::string &var_str)
QUBO++, a C++ library for generating expressions for binary and spin variables.