Skip to content

Commit b3a96cb

Browse files
authored
Merge pull request ERGO-Code#1809 from fwesselm/moreCompilerWarningsFun2
Uninitialized member variables
2 parents 337e8a3 + 093a696 commit b3a96cb

File tree

8 files changed

+427
-124
lines changed

8 files changed

+427
-124
lines changed

src/io/HighsIO.h

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,23 @@ struct HighsLogOptions {
4545
bool* output_flag;
4646
bool* log_to_console;
4747
HighsInt* log_dev_level;
48-
void (*user_log_callback)(HighsLogType, const char*, void*) = nullptr;
49-
void* user_log_callback_data = nullptr;
48+
void (*user_log_callback)(HighsLogType, const char*, void*);
49+
void* user_log_callback_data;
5050
std::function<void(int, const std::string&, const HighsCallbackDataOut*,
5151
HighsCallbackDataIn*, void*)>
5252
user_callback;
53-
void* user_callback_data = nullptr;
54-
bool user_callback_active = false;
53+
void* user_callback_data;
54+
bool user_callback_active;
5555
void clear();
56+
HighsLogOptions()
57+
: log_stream(nullptr),
58+
output_flag(nullptr),
59+
log_to_console(nullptr),
60+
log_dev_level(nullptr),
61+
user_log_callback(nullptr),
62+
user_log_callback_data(nullptr),
63+
user_callback_data(nullptr),
64+
user_callback_active(false){};
5665
};
5766

5867
/**

src/lp_data/HighsOptions.h

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,128 @@ struct HighsOptionsStruct {
424424
// Logging callback identifiers
425425
HighsLogOptions log_options;
426426
virtual ~HighsOptionsStruct() {}
427+
428+
HighsOptionsStruct()
429+
: presolve(""),
430+
solver(""),
431+
parallel(""),
432+
run_crossover(""),
433+
time_limit(0.0),
434+
solution_file(""),
435+
write_model_file(""),
436+
random_seed(0),
437+
ranging(""),
438+
infinite_cost(0.0),
439+
infinite_bound(0.0),
440+
small_matrix_value(0.0),
441+
large_matrix_value(0.0),
442+
primal_feasibility_tolerance(0.0),
443+
dual_feasibility_tolerance(0.0),
444+
ipm_optimality_tolerance(0.0),
445+
objective_bound(0.0),
446+
objective_target(0.0),
447+
threads(0),
448+
user_bound_scale(0),
449+
user_cost_scale(0),
450+
highs_debug_level(0),
451+
highs_analysis_level(0),
452+
simplex_strategy(0),
453+
simplex_scale_strategy(0),
454+
simplex_crash_strategy(0),
455+
simplex_dual_edge_weight_strategy(0),
456+
simplex_primal_edge_weight_strategy(0),
457+
simplex_iteration_limit(0),
458+
simplex_update_limit(0),
459+
simplex_min_concurrency(0),
460+
simplex_max_concurrency(0),
461+
log_file(""),
462+
write_model_to_file(false),
463+
write_solution_to_file(false),
464+
write_solution_style(0),
465+
glpsol_cost_row_location(0),
466+
output_flag(false),
467+
log_to_console(false),
468+
ipm_iteration_limit(0),
469+
pdlp_native_termination(false),
470+
pdlp_scaling(false),
471+
pdlp_iteration_limit(0),
472+
pdlp_e_restart_method(0),
473+
pdlp_d_gap_tol(0.0),
474+
qp_iteration_limit(0),
475+
qp_nullspace_limit(0),
476+
log_dev_level(0),
477+
log_githash(false),
478+
solve_relaxation(false),
479+
allow_unbounded_or_infeasible(false),
480+
use_implied_bounds_from_presolve(false),
481+
lp_presolve_requires_basis_postsolve(false),
482+
mps_parser_type_free(false),
483+
keep_n_rows(0),
484+
cost_scale_factor(0),
485+
allowed_matrix_scale_factor(0),
486+
allowed_cost_scale_factor(0),
487+
ipx_dualize_strategy(0),
488+
simplex_dualize_strategy(0),
489+
simplex_permute_strategy(0),
490+
max_dual_simplex_cleanup_level(0),
491+
max_dual_simplex_phase1_cleanup_level(0),
492+
simplex_price_strategy(0),
493+
simplex_unscaled_solution_strategy(0),
494+
presolve_reduction_limit(0),
495+
restart_presolve_reduction_limit(0),
496+
presolve_substitution_maxfillin(0),
497+
presolve_rule_off(0),
498+
presolve_rule_logging(false),
499+
simplex_initial_condition_check(false),
500+
no_unnecessary_rebuild_refactor(false),
501+
simplex_initial_condition_tolerance(0.0),
502+
rebuild_refactor_solution_error_tolerance(0.0),
503+
dual_steepest_edge_weight_error_tolerance(0.0),
504+
dual_steepest_edge_weight_log_error_threshold(0.0),
505+
dual_simplex_cost_perturbation_multiplier(0.0),
506+
primal_simplex_bound_perturbation_multiplier(0.0),
507+
dual_simplex_pivot_growth_tolerance(0.0),
508+
presolve_pivot_threshold(0.0),
509+
factor_pivot_threshold(0.0),
510+
factor_pivot_tolerance(0.0),
511+
start_crossover_tolerance(0.0),
512+
less_infeasible_DSE_check(false),
513+
less_infeasible_DSE_choose_row(false),
514+
use_original_HFactor_logic(false),
515+
run_centring(false),
516+
max_centring_steps(0),
517+
centring_ratio_tolerance(0.0),
518+
icrash(false),
519+
icrash_dualize(false),
520+
icrash_strategy(""),
521+
icrash_starting_weight(0.0),
522+
icrash_iterations(0),
523+
icrash_approx_iter(0),
524+
icrash_exact(false),
525+
icrash_breakpoints(false),
526+
mip_detect_symmetry(false),
527+
mip_allow_restart(false),
528+
mip_max_nodes(0),
529+
mip_max_stall_nodes(0),
530+
mip_max_leaves(0),
531+
mip_max_improving_sols(0),
532+
mip_lp_age_limit(0),
533+
mip_pool_age_limit(0),
534+
mip_pool_soft_limit(0),
535+
mip_pscost_minreliable(0),
536+
mip_min_cliquetable_entries_for_parallelism(0),
537+
mip_report_level(0),
538+
mip_feasibility_tolerance(0.0),
539+
mip_rel_gap(0.0),
540+
mip_abs_gap(0.0),
541+
mip_heuristic_effort(0.0),
542+
mip_min_logging_interval(0.0),
543+
#ifdef HIGHS_DEBUGSOL
544+
mip_debug_solution_file(""),
545+
#endif
546+
mip_improving_solution_save(false),
547+
mip_improving_solution_report_sparse(false),
548+
mip_improving_solution_file(""){};
427549
};
428550

429551
// For now, but later change so HiGHS properties are string based so that new

src/mip/HighsDomain.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,7 @@ class HighsDomain {
358358
conflictPoolPropagation(other.conflictPoolPropagation),
359359
infeasible_(other.infeasible_),
360360
infeasible_reason(other.infeasible_reason),
361+
infeasible_pos(other.infeasible_pos),
361362
colLowerPos_(other.colLowerPos_),
362363
colUpperPos_(other.colUpperPos_),
363364
branchPos_(other.branchPos_),

src/mip/HighsSearch.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ class HighsSearch {
9696
std::shared_ptr<const StabilizerOrbits> stabilizerOrbits = nullptr)
9797
: lower_bound(parentlb),
9898
estimate(parentestimate),
99+
branching_point(0.0),
99100
lp_objective(-kHighsInf),
100101
other_child_lb(parentlb),
101102
nodeBasis(std::move(parentBasis)),

src/presolve/ICrash.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,13 @@ struct Quadratic {
8585
double mu;
8686
std::vector<double> lambda;
8787

88-
Quadratic(HighsLp lp_, ICrashOptions options_) : lp(lp_), options(options_) {}
88+
Quadratic(HighsLp lp_, ICrashOptions options_)
89+
: lp(lp_),
90+
options(options_),
91+
lp_objective(0.0),
92+
quadratic_objective(0.0),
93+
residual_norm_2(0.0),
94+
mu(0.0) {}
8995
};
9096

9197
// Functions: Call.

src/simplex/HEkk.h

Lines changed: 51 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,41 @@ class HighsLpSolverObject;
2525

2626
class HEkk {
2727
public:
28-
HEkk() {}
28+
HEkk()
29+
: callback_(nullptr),
30+
options_(nullptr),
31+
timer_(nullptr),
32+
lp_name_(""),
33+
model_status_(HighsModelStatus::kNotset),
34+
simplex_in_scaled_space_(false),
35+
cost_scale_(1.0),
36+
cost_perturbation_base_(0.0),
37+
cost_perturbation_max_abs_cost_(0.0),
38+
iteration_count_(0),
39+
dual_simplex_cleanup_level_(0),
40+
dual_simplex_phase1_cleanup_level_(0),
41+
previous_iteration_cycling_detected(-kHighsIInf),
42+
solve_bailout_(false),
43+
called_return_from_solve_(false),
44+
exit_algorithm_(SimplexAlgorithm::kNone),
45+
return_primal_solution_status_(0),
46+
return_dual_solution_status_(0),
47+
original_num_col_(0),
48+
original_num_row_(0),
49+
original_num_nz_(0),
50+
original_offset_(0.0),
51+
edge_weight_error_(0.0),
52+
build_synthetic_tick_(0.0),
53+
total_synthetic_tick_(0.0),
54+
debug_solve_call_num_(0),
55+
debug_basis_id_(0),
56+
time_report_(false),
57+
debug_initial_build_synthetic_tick_(0),
58+
debug_solve_report_(false),
59+
debug_iteration_report_(false),
60+
debug_basis_report_(false),
61+
debug_dual_feasible(false),
62+
debug_max_relative_dual_steepest_edge_weight_error(0) {}
2963
/**
3064
* @brief Interface to simplex solvers
3165
*/
@@ -155,14 +189,14 @@ class HEkk {
155189
HSimplexNla simplex_nla_;
156190
HotStart hot_start_;
157191

158-
double cost_scale_ = 1;
192+
double cost_scale_;
159193
double cost_perturbation_base_;
160194
double cost_perturbation_max_abs_cost_;
161-
HighsInt iteration_count_ = 0;
162-
HighsInt dual_simplex_cleanup_level_ = 0;
163-
HighsInt dual_simplex_phase1_cleanup_level_ = 0;
195+
HighsInt iteration_count_;
196+
HighsInt dual_simplex_cleanup_level_;
197+
HighsInt dual_simplex_phase1_cleanup_level_;
164198

165-
HighsInt previous_iteration_cycling_detected = -kHighsIInf;
199+
HighsInt previous_iteration_cycling_detected;
166200

167201
bool solve_bailout_;
168202
bool called_return_from_solve_;
@@ -197,17 +231,17 @@ class HEkk {
197231

198232
double edge_weight_error_;
199233

200-
double build_synthetic_tick_ = 0;
201-
double total_synthetic_tick_ = 0;
202-
HighsInt debug_solve_call_num_ = 0;
203-
HighsInt debug_basis_id_ = 0;
204-
bool time_report_ = false;
205-
HighsInt debug_initial_build_synthetic_tick_ = 0;
206-
bool debug_solve_report_ = false;
207-
bool debug_iteration_report_ = false;
208-
bool debug_basis_report_ = false;
209-
bool debug_dual_feasible = false;
210-
double debug_max_relative_dual_steepest_edge_weight_error = 0;
234+
double build_synthetic_tick_;
235+
double total_synthetic_tick_;
236+
HighsInt debug_solve_call_num_;
237+
HighsInt debug_basis_id_;
238+
bool time_report_;
239+
HighsInt debug_initial_build_synthetic_tick_;
240+
bool debug_solve_report_;
241+
bool debug_iteration_report_;
242+
bool debug_basis_report_;
243+
bool debug_dual_feasible;
244+
double debug_max_relative_dual_steepest_edge_weight_error;
211245

212246
std::vector<HighsSimplexBadBasisChangeRecord> bad_basis_change_;
213247

0 commit comments

Comments
 (0)