Skip to content

Commit

Permalink
Merge pull request #1809 from fwesselm/moreCompilerWarningsFun2
Browse files Browse the repository at this point in the history
Uninitialized member variables
  • Loading branch information
jajhall authored Jun 21, 2024
2 parents 337e8a3 + 093a696 commit b3a96cb
Show file tree
Hide file tree
Showing 8 changed files with 427 additions and 124 deletions.
17 changes: 13 additions & 4 deletions src/io/HighsIO.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,23 @@ struct HighsLogOptions {
bool* output_flag;
bool* log_to_console;
HighsInt* log_dev_level;
void (*user_log_callback)(HighsLogType, const char*, void*) = nullptr;
void* user_log_callback_data = nullptr;
void (*user_log_callback)(HighsLogType, const char*, void*);
void* user_log_callback_data;
std::function<void(int, const std::string&, const HighsCallbackDataOut*,
HighsCallbackDataIn*, void*)>
user_callback;
void* user_callback_data = nullptr;
bool user_callback_active = false;
void* user_callback_data;
bool user_callback_active;
void clear();
HighsLogOptions()
: log_stream(nullptr),
output_flag(nullptr),
log_to_console(nullptr),
log_dev_level(nullptr),
user_log_callback(nullptr),
user_log_callback_data(nullptr),
user_callback_data(nullptr),
user_callback_active(false){};
};

/**
Expand Down
122 changes: 122 additions & 0 deletions src/lp_data/HighsOptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,128 @@ struct HighsOptionsStruct {
// Logging callback identifiers
HighsLogOptions log_options;
virtual ~HighsOptionsStruct() {}

HighsOptionsStruct()
: presolve(""),
solver(""),
parallel(""),
run_crossover(""),
time_limit(0.0),
solution_file(""),
write_model_file(""),
random_seed(0),
ranging(""),
infinite_cost(0.0),
infinite_bound(0.0),
small_matrix_value(0.0),
large_matrix_value(0.0),
primal_feasibility_tolerance(0.0),
dual_feasibility_tolerance(0.0),
ipm_optimality_tolerance(0.0),
objective_bound(0.0),
objective_target(0.0),
threads(0),
user_bound_scale(0),
user_cost_scale(0),
highs_debug_level(0),
highs_analysis_level(0),
simplex_strategy(0),
simplex_scale_strategy(0),
simplex_crash_strategy(0),
simplex_dual_edge_weight_strategy(0),
simplex_primal_edge_weight_strategy(0),
simplex_iteration_limit(0),
simplex_update_limit(0),
simplex_min_concurrency(0),
simplex_max_concurrency(0),
log_file(""),
write_model_to_file(false),
write_solution_to_file(false),
write_solution_style(0),
glpsol_cost_row_location(0),
output_flag(false),
log_to_console(false),
ipm_iteration_limit(0),
pdlp_native_termination(false),
pdlp_scaling(false),
pdlp_iteration_limit(0),
pdlp_e_restart_method(0),
pdlp_d_gap_tol(0.0),
qp_iteration_limit(0),
qp_nullspace_limit(0),
log_dev_level(0),
log_githash(false),
solve_relaxation(false),
allow_unbounded_or_infeasible(false),
use_implied_bounds_from_presolve(false),
lp_presolve_requires_basis_postsolve(false),
mps_parser_type_free(false),
keep_n_rows(0),
cost_scale_factor(0),
allowed_matrix_scale_factor(0),
allowed_cost_scale_factor(0),
ipx_dualize_strategy(0),
simplex_dualize_strategy(0),
simplex_permute_strategy(0),
max_dual_simplex_cleanup_level(0),
max_dual_simplex_phase1_cleanup_level(0),
simplex_price_strategy(0),
simplex_unscaled_solution_strategy(0),
presolve_reduction_limit(0),
restart_presolve_reduction_limit(0),
presolve_substitution_maxfillin(0),
presolve_rule_off(0),
presolve_rule_logging(false),
simplex_initial_condition_check(false),
no_unnecessary_rebuild_refactor(false),
simplex_initial_condition_tolerance(0.0),
rebuild_refactor_solution_error_tolerance(0.0),
dual_steepest_edge_weight_error_tolerance(0.0),
dual_steepest_edge_weight_log_error_threshold(0.0),
dual_simplex_cost_perturbation_multiplier(0.0),
primal_simplex_bound_perturbation_multiplier(0.0),
dual_simplex_pivot_growth_tolerance(0.0),
presolve_pivot_threshold(0.0),
factor_pivot_threshold(0.0),
factor_pivot_tolerance(0.0),
start_crossover_tolerance(0.0),
less_infeasible_DSE_check(false),
less_infeasible_DSE_choose_row(false),
use_original_HFactor_logic(false),
run_centring(false),
max_centring_steps(0),
centring_ratio_tolerance(0.0),
icrash(false),
icrash_dualize(false),
icrash_strategy(""),
icrash_starting_weight(0.0),
icrash_iterations(0),
icrash_approx_iter(0),
icrash_exact(false),
icrash_breakpoints(false),
mip_detect_symmetry(false),
mip_allow_restart(false),
mip_max_nodes(0),
mip_max_stall_nodes(0),
mip_max_leaves(0),
mip_max_improving_sols(0),
mip_lp_age_limit(0),
mip_pool_age_limit(0),
mip_pool_soft_limit(0),
mip_pscost_minreliable(0),
mip_min_cliquetable_entries_for_parallelism(0),
mip_report_level(0),
mip_feasibility_tolerance(0.0),
mip_rel_gap(0.0),
mip_abs_gap(0.0),
mip_heuristic_effort(0.0),
mip_min_logging_interval(0.0),
#ifdef HIGHS_DEBUGSOL
mip_debug_solution_file(""),
#endif
mip_improving_solution_save(false),
mip_improving_solution_report_sparse(false),
mip_improving_solution_file(""){};
};

// For now, but later change so HiGHS properties are string based so that new
Expand Down
1 change: 1 addition & 0 deletions src/mip/HighsDomain.h
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,7 @@ class HighsDomain {
conflictPoolPropagation(other.conflictPoolPropagation),
infeasible_(other.infeasible_),
infeasible_reason(other.infeasible_reason),
infeasible_pos(other.infeasible_pos),
colLowerPos_(other.colLowerPos_),
colUpperPos_(other.colUpperPos_),
branchPos_(other.branchPos_),
Expand Down
1 change: 1 addition & 0 deletions src/mip/HighsSearch.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ class HighsSearch {
std::shared_ptr<const StabilizerOrbits> stabilizerOrbits = nullptr)
: lower_bound(parentlb),
estimate(parentestimate),
branching_point(0.0),
lp_objective(-kHighsInf),
other_child_lb(parentlb),
nodeBasis(std::move(parentBasis)),
Expand Down
8 changes: 7 additions & 1 deletion src/presolve/ICrash.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,13 @@ struct Quadratic {
double mu;
std::vector<double> lambda;

Quadratic(HighsLp lp_, ICrashOptions options_) : lp(lp_), options(options_) {}
Quadratic(HighsLp lp_, ICrashOptions options_)
: lp(lp_),
options(options_),
lp_objective(0.0),
quadratic_objective(0.0),
residual_norm_2(0.0),
mu(0.0) {}
};

// Functions: Call.
Expand Down
68 changes: 51 additions & 17 deletions src/simplex/HEkk.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,41 @@ class HighsLpSolverObject;

class HEkk {
public:
HEkk() {}
HEkk()
: callback_(nullptr),
options_(nullptr),
timer_(nullptr),
lp_name_(""),
model_status_(HighsModelStatus::kNotset),
simplex_in_scaled_space_(false),
cost_scale_(1.0),
cost_perturbation_base_(0.0),
cost_perturbation_max_abs_cost_(0.0),
iteration_count_(0),
dual_simplex_cleanup_level_(0),
dual_simplex_phase1_cleanup_level_(0),
previous_iteration_cycling_detected(-kHighsIInf),
solve_bailout_(false),
called_return_from_solve_(false),
exit_algorithm_(SimplexAlgorithm::kNone),
return_primal_solution_status_(0),
return_dual_solution_status_(0),
original_num_col_(0),
original_num_row_(0),
original_num_nz_(0),
original_offset_(0.0),
edge_weight_error_(0.0),
build_synthetic_tick_(0.0),
total_synthetic_tick_(0.0),
debug_solve_call_num_(0),
debug_basis_id_(0),
time_report_(false),
debug_initial_build_synthetic_tick_(0),
debug_solve_report_(false),
debug_iteration_report_(false),
debug_basis_report_(false),
debug_dual_feasible(false),
debug_max_relative_dual_steepest_edge_weight_error(0) {}
/**
* @brief Interface to simplex solvers
*/
Expand Down Expand Up @@ -155,14 +189,14 @@ class HEkk {
HSimplexNla simplex_nla_;
HotStart hot_start_;

double cost_scale_ = 1;
double cost_scale_;
double cost_perturbation_base_;
double cost_perturbation_max_abs_cost_;
HighsInt iteration_count_ = 0;
HighsInt dual_simplex_cleanup_level_ = 0;
HighsInt dual_simplex_phase1_cleanup_level_ = 0;
HighsInt iteration_count_;
HighsInt dual_simplex_cleanup_level_;
HighsInt dual_simplex_phase1_cleanup_level_;

HighsInt previous_iteration_cycling_detected = -kHighsIInf;
HighsInt previous_iteration_cycling_detected;

bool solve_bailout_;
bool called_return_from_solve_;
Expand Down Expand Up @@ -197,17 +231,17 @@ class HEkk {

double edge_weight_error_;

double build_synthetic_tick_ = 0;
double total_synthetic_tick_ = 0;
HighsInt debug_solve_call_num_ = 0;
HighsInt debug_basis_id_ = 0;
bool time_report_ = false;
HighsInt debug_initial_build_synthetic_tick_ = 0;
bool debug_solve_report_ = false;
bool debug_iteration_report_ = false;
bool debug_basis_report_ = false;
bool debug_dual_feasible = false;
double debug_max_relative_dual_steepest_edge_weight_error = 0;
double build_synthetic_tick_;
double total_synthetic_tick_;
HighsInt debug_solve_call_num_;
HighsInt debug_basis_id_;
bool time_report_;
HighsInt debug_initial_build_synthetic_tick_;
bool debug_solve_report_;
bool debug_iteration_report_;
bool debug_basis_report_;
bool debug_dual_feasible;
double debug_max_relative_dual_steepest_edge_weight_error;

std::vector<HighsSimplexBadBasisChangeRecord> bad_basis_change_;

Expand Down
Loading

0 comments on commit b3a96cb

Please sign in to comment.