-
Notifications
You must be signed in to change notification settings - Fork 197
/
Copy pathHStruct.h
168 lines (145 loc) · 4.55 KB
/
HStruct.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the HiGHS linear optimization suite */
/* */
/* Available as open-source under the MIT License */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**@file lp_data/HStruct.h
* @brief Structs for HiGHS
*/
#ifndef LP_DATA_HSTRUCT_H_
#define LP_DATA_HSTRUCT_H_
#include <unordered_map>
#include <vector>
#include "lp_data/HConst.h"
struct HighsIterationCounts {
HighsInt simplex = 0;
HighsInt ipm = 0;
HighsInt crossover = 0;
HighsInt qp = 0;
};
struct HighsSolution {
bool value_valid = false;
bool dual_valid = false;
std::vector<double> col_value;
std::vector<double> col_dual;
std::vector<double> row_value;
std::vector<double> row_dual;
bool hasUndefined();
void invalidate();
void clear();
};
struct HighsObjectiveSolution {
double objective;
std::vector<double> col_value;
void clear();
};
struct RefactorInfo {
bool use = false;
std::vector<HighsInt> pivot_row;
std::vector<HighsInt> pivot_var;
std::vector<int8_t> pivot_type;
double build_synthetic_tick;
void clear();
};
struct HotStart {
bool valid = false;
RefactorInfo refactor_info;
std::vector<int8_t> nonbasicMove;
void clear();
};
struct HighsBasis {
bool valid = false;
bool alien = true;
bool was_alien = true;
HighsInt debug_id = -1;
HighsInt debug_update_count = -1;
std::string debug_origin_name = "None";
std::vector<HighsBasisStatus> col_status;
std::vector<HighsBasisStatus> row_status;
void invalidate();
void clear();
};
struct HighsScale {
HighsInt strategy;
bool has_scaling;
HighsInt num_col;
HighsInt num_row;
double cost;
std::vector<double> col;
std::vector<double> row;
};
struct HighsLpMods {
// Semi-variables with zero lower bound that are treated as non-semi
std::vector<HighsInt> save_non_semi_variable_index;
// Semi-variables with inconsistent bounds that are fixed at zero
std::vector<HighsInt> save_inconsistent_semi_variable_index;
std::vector<double> save_inconsistent_semi_variable_lower_bound_value;
std::vector<double> save_inconsistent_semi_variable_upper_bound_value;
std::vector<HighsVarType> save_inconsistent_semi_variable_type;
// Semi-variables whose lower bound is ignored when solving the
// relaxation
std::vector<HighsInt> save_relaxed_semi_variable_lower_bound_index;
std::vector<double> save_relaxed_semi_variable_lower_bound_value;
// Semi-variables whose upper bound is too large to be used as a
// big-M when converting them to an integer variables plus an
// integer/continuous variables as appropriate
std::vector<HighsInt> save_tightened_semi_variable_upper_bound_index;
std::vector<double> save_tightened_semi_variable_upper_bound_value;
// Variables with infinite costs that are fixed during solve
std::vector<HighsInt> save_inf_cost_variable_index;
std::vector<double> save_inf_cost_variable_cost;
std::vector<double> save_inf_cost_variable_lower;
std::vector<double> save_inf_cost_variable_upper;
void clear();
bool isClear();
};
struct HighsNameHash {
std::unordered_map<std::string, int> name2index;
void form(const std::vector<std::string>& name);
bool hasDuplicate(const std::vector<std::string>& name);
void update(int index, const std::string& old_name,
const std::string& new_name);
void clear();
};
struct HighsPresolveRuleLog {
HighsInt call;
HighsInt col_removed;
HighsInt row_removed;
};
struct HighsPresolveLog {
std::vector<HighsPresolveRuleLog> rule;
void clear();
};
struct HighsIllConditioningRecord {
HighsInt index;
double multiplier;
};
struct HighsIllConditioning {
std::vector<HighsIllConditioningRecord> record;
void clear();
};
struct HighsLinearObjective {
double weight;
double offset;
std::vector<double> coefficients;
double abs_tolerance;
double rel_tolerance;
HighsInt priority;
void clear();
};
struct HighsSimplexStats {
bool valid;
HighsInt iteration_count;
HighsInt num_invert;
HighsInt last_invert_num_el;
HighsInt last_factored_basis_num_el;
double col_aq_density;
double row_ep_density;
double row_ap_density;
double row_DSE_density;
void report(FILE* file, const std::string message = "") const;
void initialise(const HighsInt iteration_count_ = 0);
};
#endif /* LP_DATA_HSTRUCT_H_ */