Solution holder to store the best solution of factorization.
More...
Solution holder to store the best solution of factorization.
- Note
- Inherited from qbpp::SolHolder. Member variable "bound", which stores the bound of the best solution found by Gurobi, is added.
Definition at line 102 of file factorization.cpp.
◆ SolHolder() [1/3]
Constructor with a quad_model.
- Parameters
-
quad_model | The QUBO quad_model. |
fix_lsb | True if the LSBs of x and y are fixed to 1. |
var_x | The vector of Var. |
var_y | The vector of Var. |
Definition at line 124 of file factorization.cpp.
◆ SolHolder() [2/3]
Constructor with a quad_model.
- Parameters
-
quad_model | The QUBO quad_model. |
fix_lsb | True if the LSBs of z are fixed to 1. |
var_z | The vector of Var. |
Definition at line 137 of file factorization.cpp.
◆ SolHolder() [3/3]
qbpp::factorization::SolHolder::SolHolder |
( |
const SolHolder & |
sol_holder | ) |
|
|
default |
◆ set_bound() [1/2]
void qbpp::factorization::SolHolder::set_bound |
( |
int64_t |
bound | ) |
|
|
inline |
Sets the bound value of the best solution.
- Parameters
-
Definition at line 150 of file factorization.cpp.
◆ get_bound()
std::optional<int64_t> qbpp::factorization::SolHolder::get_bound |
( |
| ) |
const |
|
inline |
Gets the bound value of the best solution.
- Returns
- int64_t The bound value.
Definition at line 154 of file factorization.cpp.
◆ get_bound_str()
std::string qbpp::factorization::SolHolder::get_bound_str |
( |
| ) |
const |
|
inline |
Gets the bound value of the best solution as a string.
- Returns
- std::string The bound value as a string.
Definition at line 158 of file factorization.cpp.
◆ set_if_better()
std::optional<double> qbpp::factorization::SolHolder::set_if_better |
( |
const qbpp::Sol & |
new_sol, |
|
|
const std::string & |
solver |
|
) |
| |
|
inlineoverridevirtual |
Sets new_sol as the best solution if it is better than the current best solution.
- Parameters
-
new_sol | The new solution. |
solver | The solver name. |
- Returns
- std::optional<std::chrono::milliseconds> The time to solution if the current best solution is updated by new_sol.
Reimplemented from qbpp::SolHolder.
Definition at line 172 of file factorization.cpp.
◆ get_if_better() [1/2]
virtual std::optional<qbpp::Sol> qbpp::SolHolder::get_if_better |
( |
energy_t |
my_energy | ) |
|
|
inlinevirtualinherited |
◆ get_if_better() [2/2]
std::optional<qbpp::Sol> qbpp::SolHolder::get_if_better |
( |
const Sol & |
my_sol | ) |
|
|
inlineinherited |
◆ get_sol_tts_solver()
std::tuple<Sol, double, std::string> qbpp::SolHolder::get_sol_tts_solver |
( |
| ) |
const |
|
inlineinherited |
◆ var_count()
vindex_t qbpp::SolHolder::var_count |
( |
| ) |
const |
|
inlineinherited |
◆ get_energy()
energy_t qbpp::SolHolder::get_energy |
( |
| ) |
const |
|
inlineinherited |
◆ get_sol()
const Sol& qbpp::SolHolder::get_sol |
( |
| ) |
const |
|
inlineinherited |
◆ copy_sol()
Sol qbpp::SolHolder::copy_sol |
( |
| ) |
const |
|
inlineinherited |
◆ clear()
void qbpp::SolHolder::clear |
( |
| ) |
|
|
inlineinherited |
◆ get_tts()
double qbpp::SolHolder::get_tts |
( |
| ) |
const |
|
inlineinherited |
◆ get_solver()
std::string qbpp::SolHolder::get_solver |
( |
| ) |
const |
|
inlineinherited |
◆ set_bound() [2/2]
void qbpp::SolHolder::set_bound |
( |
energy_t |
bound | ) |
|
|
inlineinherited |
◆ operator Sol()
qbpp::SolHolder::operator Sol |
( |
| ) |
const |
|
inlineinherited |
◆ factorization_mode
const bool qbpp::factorization::SolHolder::factorization_mode = true |
|
private |
◆ fix_lsb
const bool qbpp::factorization::SolHolder::fix_lsb = false |
|
private |
True if the MSBs and LSBs of x, y, and z are fixed.
Definition at line 106 of file factorization.cpp.
◆ var_x
◆ var_y
◆ var_z
◆ bound
std::optional<int64_t> qbpp::factorization::SolHolder::bound = std::nullopt |
|
private |
◆ mtx
std::mutex qbpp::factorization::SolHolder::mtx |
|
mutableprivate |
◆ sol_
Sol qbpp::SolHolder::sol_ |
|
protectedinherited |
◆ bound_
std::optional<energy_t> qbpp::SolHolder::bound_ = std::nullopt |
|
protectedinherited |
◆ startx_
double qbpp::SolHolder::startx_ = get_time() |
|
protectedinherited |
◆ tts_
double qbpp::SolHolder::tts_ {0.0} |
|
protectedinherited |
◆ solver_
std::string qbpp::SolHolder::solver_ = "N/A" |
|
protectedinherited |
◆ mtx_
std::mutex qbpp::SolHolder::mtx_ |
|
mutableprotectedinherited |
The documentation for this class was generated from the following file: