![]() |
Google OR-Tools v9.12
a fast and portable software suite for combinatorial optimization
|
#include <model_builder_helper.h>
Public Member Functions | |
ModelSolverHelper (const std::string &solver_name) | |
bool | SolverIsSupported () const |
void | Solve (const ModelBuilderHelper &model) |
std::optional< MPSolutionResponse > | SolveRequest (const MPModelRequest &request) |
Only used by the CVXPY interface. Does not store the response internally. | |
bool | InterruptSolve () |
void | SetLogCallback (std::function< void(const std::string &)> log_callback) |
void | SetLogCallbackFromDirectorClass (MbLogCallback *log_callback) |
void | ClearLogCallback () |
bool | has_response () const |
bool | has_solution () const |
const MPSolutionResponse & | response () const |
SolveStatus | status () const |
double | objective_value () const |
If not defined, or no solution, they will silently return 0. | |
double | best_objective_bound () const |
double | variable_value (int var_index) const |
double | expression_value (std::shared_ptr< LinearExpr > expr) const |
double | reduced_cost (int var_index) const |
double | dual_value (int ct_index) const |
double | activity (int ct_index) |
std::string | status_string () const |
double | wall_time () const |
double | user_time () const |
void | SetTimeLimitInSeconds (double limit) |
Solve parameters. | |
void | SetSolverSpecificParameters (const std::string &solver_specific_parameters) |
void | EnableOutput (bool enabled) |
Class used to solve a request. This class is not meant to be exposed to the public. Its responsibility is to bridge the MPModelProto in the non-C++ languages with the C++ Solve method.
It contains 2 helper objects: a logger, and an atomic bool to interrupt search.
Definition at line 489 of file model_builder_helper.h.
|
explicit |
Definition at line 524 of file model_builder_helper.cc.
double operations_research::mb::ModelSolverHelper::activity | ( | int | ct_index | ) |
Definition at line 740 of file model_builder_helper.cc.
double operations_research::mb::ModelSolverHelper::best_objective_bound | ( | ) | const |
Definition at line 709 of file model_builder_helper.cc.
void operations_research::mb::ModelSolverHelper::ClearLogCallback | ( | ) |
Definition at line 675 of file model_builder_helper.cc.
double operations_research::mb::ModelSolverHelper::dual_value | ( | int | ct_index | ) | const |
Definition at line 734 of file model_builder_helper.cc.
void operations_research::mb::ModelSolverHelper::EnableOutput | ( | bool | enabled | ) |
Definition at line 785 of file model_builder_helper.cc.
double operations_research::mb::ModelSolverHelper::expression_value | ( | std::shared_ptr< LinearExpr > | expr | ) | const |
Definition at line 720 of file model_builder_helper.cc.
bool operations_research::mb::ModelSolverHelper::has_response | ( | ) | const |
Definition at line 683 of file model_builder_helper.cc.
bool operations_research::mb::ModelSolverHelper::has_solution | ( | ) | const |
Definition at line 685 of file model_builder_helper.cc.
bool operations_research::mb::ModelSolverHelper::InterruptSolve | ( | ) |
Returns true if the interrupt signal was correctly sent, that is if the underlying solver supports it.
Definition at line 677 of file model_builder_helper.cc.
double operations_research::mb::ModelSolverHelper::objective_value | ( | ) | const |
If not defined, or no solution, they will silently return 0.
Definition at line 704 of file model_builder_helper.cc.
double operations_research::mb::ModelSolverHelper::reduced_cost | ( | int | var_index | ) | const |
Definition at line 728 of file model_builder_helper.cc.
const MPSolutionResponse & operations_research::mb::ModelSolverHelper::response | ( | ) | const |
Definition at line 693 of file model_builder_helper.cc.
void operations_research::mb::ModelSolverHelper::SetLogCallback | ( | std::function< void(const std::string &)> | log_callback | ) |
Definition at line 663 of file model_builder_helper.cc.
void operations_research::mb::ModelSolverHelper::SetLogCallbackFromDirectorClass | ( | MbLogCallback * | log_callback | ) |
Definition at line 668 of file model_builder_helper.cc.
void operations_research::mb::ModelSolverHelper::SetSolverSpecificParameters | ( | const std::string & | solver_specific_parameters | ) |
Definition at line 780 of file model_builder_helper.cc.
void operations_research::mb::ModelSolverHelper::SetTimeLimitInSeconds | ( | double | limit | ) |
Solve parameters.
Definition at line 776 of file model_builder_helper.cc.
void operations_research::mb::ModelSolverHelper::Solve | ( | const ModelBuilderHelper & | model | ) |
std::optional< MPSolutionResponse > operations_research::mb::ModelSolverHelper::SolveRequest | ( | const MPModelRequest & | request | ) |
Only used by the CVXPY interface. Does not store the response internally.
Definition at line 477 of file model_builder_helper.cc.
bool operations_research::mb::ModelSolverHelper::SolverIsSupported | ( | ) | const |
Definition at line 535 of file model_builder_helper.cc.
SolveStatus operations_research::mb::ModelSolverHelper::status | ( | ) | const |
Definition at line 697 of file model_builder_helper.cc.
std::string operations_research::mb::ModelSolverHelper::status_string | ( | ) | const |
Definition at line 759 of file model_builder_helper.cc.
double operations_research::mb::ModelSolverHelper::user_time | ( | ) | const |
Definition at line 770 of file model_builder_helper.cc.
double operations_research::mb::ModelSolverHelper::variable_value | ( | int | var_index | ) | const |
Definition at line 714 of file model_builder_helper.cc.
double operations_research::mb::ModelSolverHelper::wall_time | ( | ) | const |
Definition at line 764 of file model_builder_helper.cc.