21 static std::unique_ptr<DynamicLib> m_dynamic_lib;
23 bool m_continuous_relaxation;
27 SolutionStatus m_solution_status = Loaded;
28 SolutionReason m_solution_reason = NotSpecified;
29 double* m_extreme_ray =
nullptr;
30 double* m_farkas_certificate =
nullptr;
31 double* m_col_value =
nullptr;
32 double* m_col_dual =
nullptr;
33 double* m_row_value =
nullptr;
34 double* m_row_dual =
nullptr;
38 void hook_build()
override;
39 void hook_optimize()
override;
40 void run_without_presolve();
41 void hook_write(
const std::string &t_name)
override;
42 int hook_add(
const Var &t_var,
bool t_add_column)
override;
43 int hook_add(
const Ctr &t_ctr)
override;
44 int hook_add(
const QCtr &t_ctr)
override;
45 int hook_add(
const SOSCtr &t_ctr)
override;
46 void hook_update_objective_sense()
override;
47 void update_objective_constant();
48 void hook_update_matrix(
const Ctr &t_ctr,
const Var &t_var,
double t_constant)
override;
49 void hook_update()
override;
50 void hook_update(
const Var &t_var)
override;
51 void hook_update(
const Ctr &t_ctr)
override;
52 void hook_update_objective()
override;
53 void hook_update_rhs()
override;
54 void hook_remove(
const Var &t_var)
override;
55 void hook_remove(
const Ctr &t_ctr)
override;
56 void hook_remove(
const QCtr &t_ctr)
override;
57 void hook_remove(
const SOSCtr &t_ctr)
override;
58 void set_var_attr(
int t_index,
int t_type,
double t_lb,
double t_ub,
double t_obj);
59 void set_var_type(
int t_index,
int t_type);
60 void set_ctr_attr(
int t_index,
int t_type,
double t_rhs);
62 [[nodiscard]] SolutionStatus get_status()
const override;
63 [[nodiscard]] SolutionReason get_reason()
const override;
64 [[nodiscard]]
double get_best_obj()
const override;
65 [[nodiscard]]
double get_best_bound()
const override;
66 [[nodiscard]]
double get_var_primal(
const Var &t_var)
const override;
67 [[nodiscard]]
double get_var_reduced_cost(
const Var &t_var)
const override;
68 [[nodiscard]]
double get_var_ray(
const Var &t_var)
const override;
69 [[nodiscard]]
double get_ctr_dual(
const Ctr &t_ctr)
const override;
70 [[nodiscard]]
double get_ctr_farkas(
const Ctr &t_ctr)
const override;
71 [[nodiscard]]
double get_relative_gap()
const override;
72 [[nodiscard]]
double get_absolute_gap()
const override;
73 [[nodiscard]]
unsigned int get_n_solutions()
const override;
74 [[nodiscard]]
unsigned int get_solution_index()
const override;
75 void set_solution_index(
unsigned int t_index)
override;
77 void analyze_status(HighsInt t_status);
79 explicit HiGHS(
const Model& t_model,
bool t_continuous_relaxation);
82 [[nodiscard]] std::string name()
const override {
return "HiGHS"; }
83 void set_param_time_limit(
double t_time_limit)
override;
84 void set_param_best_obj_stop(
double t_best_obj_stop)
override;
85 void set_param_best_bound_stop(
double t_best_bound_stop)
override;
86 void set_param_presolve(
bool t_value)
override;
87 void set_param_logs(
bool t_value)
override;
97 void* m_handle =
nullptr;
99 static std::string find_library();
101 HIGHS_SYM_PTR(Highs_create);
102 HIGHS_SYM_PTR(Highs_clearSolver);
103 HIGHS_SYM_PTR(Highs_addCol);
104 HIGHS_SYM_PTR(Highs_addRow);
105 HIGHS_SYM_PTR(Highs_deleteColsByRange);
106 HIGHS_SYM_PTR(Highs_deleteRowsByRange);
107 HIGHS_SYM_PTR(Highs_changeColBounds);
108 HIGHS_SYM_PTR(Highs_changeColCost);
109 HIGHS_SYM_PTR(Highs_changeColIntegrality);
110 HIGHS_SYM_PTR(Highs_changeRowBounds);
111 HIGHS_SYM_PTR(Highs_changeCoeff);
112 HIGHS_SYM_PTR(Highs_changeObjectiveSense);
113 HIGHS_SYM_PTR(Highs_changeObjectiveOffset);
114 HIGHS_SYM_PTR(Highs_getObjectiveValue);
115 HIGHS_SYM_PTR(Highs_getNumCol);
116 HIGHS_SYM_PTR(Highs_getNumRow);
117 HIGHS_SYM_PTR(Highs_getNumRows);
118 HIGHS_SYM_PTR(Highs_getInfinity);
119 HIGHS_SYM_PTR(Highs_getRunTime);
120 HIGHS_SYM_PTR(Highs_getModelStatus);
121 HIGHS_SYM_PTR(Highs_run);
122 HIGHS_SYM_PTR(Highs_getSolution);
123 HIGHS_SYM_PTR(Highs_getPrimalRay);
124 HIGHS_SYM_PTR(Highs_getDualRay);
125 HIGHS_SYM_PTR(Highs_setBoolOptionValue);
126 HIGHS_SYM_PTR(Highs_setDoubleOptionValue);
127 HIGHS_SYM_PTR(Highs_setOptionValue);
128 HIGHS_SYM_PTR(Highs_getBoolOptionValue);
129 HIGHS_SYM_PTR(Highs_writeModel);