diff --git a/src/io/HMpsFF.cpp b/src/io/HMpsFF.cpp index cf18f204d5..14f0bf5dc0 100644 --- a/src/io/HMpsFF.cpp +++ b/src/io/HMpsFF.cpp @@ -2036,12 +2036,12 @@ double HMpsFF::getValue(const std::string& word, bool& is_nan, const HighsInt id) const { // Lambda to replace any d or D by E auto dD2e = [&](std::string& word) { - HighsInt ix = word.find("D"); - if (ix >= 0) { + size_t ix = word.find("D"); + if (ix != std::string::npos) { word.replace(ix, 1, "E"); } else { ix = word.find("d"); - if (ix >= 0) word.replace(ix, 1, "E"); + if (ix != std::string::npos) word.replace(ix, 1, "E"); } }; diff --git a/src/lp_data/HighsModelUtils.cpp b/src/lp_data/HighsModelUtils.cpp index 1e878740b0..6a60010282 100644 --- a/src/lp_data/HighsModelUtils.cpp +++ b/src/lp_data/HighsModelUtils.cpp @@ -319,8 +319,8 @@ bool hasNamesWithSpaces(const HighsLogOptions& log_options, const std::vector& names) { HighsInt num_names_with_spaces = 0; for (HighsInt ix = 0; ix < num_name; ix++) { - HighsInt space_pos = names[ix].find(" "); - if (space_pos >= 0) { + size_t space_pos = names[ix].find(" "); + if (space_pos != std::string::npos) { if (num_names_with_spaces == 0) { highsLogDev( log_options, HighsLogType::kInfo, diff --git a/src/mip/HighsCliqueTable.cpp b/src/mip/HighsCliqueTable.cpp index 9a51cda7f9..54490e08e0 100644 --- a/src/mip/HighsCliqueTable.cpp +++ b/src/mip/HighsCliqueTable.cpp @@ -189,7 +189,7 @@ void HighsCliqueTable::bronKerboschRecurse(BronKerboschData& data, if (data.stop()) return; double pivweight = -1.0; - CliqueVar pivot; + CliqueVar pivot{0, 0}; for (HighsInt i = 0; i != Xlen; ++i) { if (X[i].weight(data.sol) > pivweight) { @@ -2021,8 +2021,9 @@ void HighsCliqueTable::runCliqueMerging(HighsDomain& globaldomain, std::remove_if(clique.begin(), clique.end(), [&](CliqueVar v) { return globaldomain.isFixed(v.col) && - int(globaldomain.col_lower_[v.col]) == - (1 - v.val); + static_cast( + globaldomain.col_lower_[v.col]) == + static_cast(1 - v.val); }), clique.end()); } @@ -2190,8 +2191,9 @@ void HighsCliqueTable::runCliqueMerging(HighsDomain& globaldomain) { std::remove_if(extensionvars.begin(), extensionvars.end(), [&](CliqueVar v) { return globaldomain.isFixed(v.col) && - int(globaldomain.col_lower_[v.col]) == - (1 - v.val); + static_cast( + globaldomain.col_lower_[v.col]) == + static_cast(1 - v.val); }), extensionvars.end()); diff --git a/src/mip/HighsDebugSol.h b/src/mip/HighsDebugSol.h index 9c8852ad9b..ddce632c45 100644 --- a/src/mip/HighsDebugSol.h +++ b/src/mip/HighsDebugSol.h @@ -88,54 +88,47 @@ struct HighsDebugSol { #else struct HighsDebugSol { - HighsDebugSol(HighsMipSolver& mipsolver) {} + HighsDebugSol(HighsMipSolver&) {} void newIncumbentFound() const {} void activate() const {} - void shrink(const std::vector& newColIndex) const {} + void shrink(const std::vector&) const {} - void registerDomain(const HighsDomain& domain) const {} + void registerDomain(const HighsDomain&) const {} - void boundChangeAdded(const HighsDomain& domain, - const HighsDomainChange& domchg, - bool branching = false) const {} + void boundChangeAdded(const HighsDomain&, const HighsDomainChange&, + bool = false) const {} - void boundChangeRemoved(const HighsDomain& domain, - const HighsDomainChange& domchg) const {} + void boundChangeRemoved(const HighsDomain&, const HighsDomainChange&) const {} - void resetDomain(const HighsDomain& domain) const {} + void resetDomain(const HighsDomain&) const {} - void nodePruned(const HighsDomain& localdomain) const {} + void nodePruned(const HighsDomain&) const {} - void checkCut(const HighsInt* Rindex, const double* Rvalue, HighsInt Rlen, - double rhs) const {} + void checkCut(const HighsInt*, const double*, HighsInt, double) const {} - void checkRow(const HighsInt* Rindex, const double* Rvalue, HighsInt Rlen, - double Rlower, double Rupper) const {} + void checkRow(const HighsInt*, const double*, HighsInt, double, + double) const {} - void checkRowAggregation(const HighsLp& lp, const HighsInt* Rindex, - const double* Rvalue, HighsInt Rlen) const {} + void checkRowAggregation(const HighsLp&, const HighsInt*, const double*, + HighsInt) const {} - void checkClique(const HighsCliqueTable::CliqueVar* clq, - HighsInt clqlen) const {} + void checkClique(const HighsCliqueTable::CliqueVar*, HighsInt) const {} - void checkVub(HighsInt col, HighsInt vubcol, double vubcoef, - double vubconstant) const {} + void checkVub(HighsInt, HighsInt, double, double) const {} - void checkVlb(HighsInt col, HighsInt vlbcol, double vlbcoef, - double vlbconstant) const {} + void checkVlb(HighsInt, HighsInt, double, double) const {} void checkConflictReasonFrontier( - const std::set& reasonSideFrontier, - const std::vector& domchgstack) const {} + const std::set&, + const std::vector&) const {} void checkConflictReconvergenceFrontier( - const std::set& - reconvergenceFrontier, - const HighsDomain::ConflictSet::LocalDomChg& reconvDomchgPos, - const std::vector& domchgstack) const {} + const std::set&, + const HighsDomain::ConflictSet::LocalDomChg&, + const std::vector&) const {} }; #endif diff --git a/src/mip/HighsGFkSolve.h b/src/mip/HighsGFkSolve.h index 7cfd5a52e2..75519459de 100644 --- a/src/mip/HighsGFkSolve.h +++ b/src/mip/HighsGFkSolve.h @@ -39,7 +39,7 @@ struct HighsGFk; template <> struct HighsGFk<2> { static constexpr unsigned int powk(unsigned int a) { return a * a; } - static constexpr unsigned int inverse(unsigned int a) { return 1; } + static constexpr unsigned int inverse(unsigned int) { return 1; } }; template <> diff --git a/src/mip/HighsMipSolverData.cpp b/src/mip/HighsMipSolverData.cpp index 4070dfb021..1d926134ab 100644 --- a/src/mip/HighsMipSolverData.cpp +++ b/src/mip/HighsMipSolverData.cpp @@ -183,17 +183,17 @@ void HighsMipSolverData::finishSymmetryDetection( "No symmetry present\n\n"); } else if (symmetries.orbitopes.size() == 0) { highsLogUser(mipsolver.options_mip_->log_options, HighsLogType::kInfo, - "Found %" HIGHSINT_FORMAT " generators\n\n", + "Found %" HIGHSINT_FORMAT " generator(s)\n\n", symmetries.numGenerators); } else { if (symmetries.numPerms != 0) { - highsLogUser(mipsolver.options_mip_->log_options, HighsLogType::kInfo, - "Found %" HIGHSINT_FORMAT " generators and %" HIGHSINT_FORMAT - " full orbitope(s) acting on %" HIGHSINT_FORMAT - " columns\n\n", - symmetries.numPerms, (HighsInt)symmetries.orbitopes.size(), - (HighsInt)symmetries.columnToOrbitope.size()); + highsLogUser( + mipsolver.options_mip_->log_options, HighsLogType::kInfo, + "Found %" HIGHSINT_FORMAT " generator(s) and %" HIGHSINT_FORMAT + " full orbitope(s) acting on %" HIGHSINT_FORMAT " columns\n\n", + symmetries.numPerms, (HighsInt)symmetries.orbitopes.size(), + (HighsInt)symmetries.columnToOrbitope.size()); } else { highsLogUser(mipsolver.options_mip_->log_options, HighsLogType::kInfo, "Found %" HIGHSINT_FORMAT diff --git a/src/mip/HighsMipSolverData.h b/src/mip/HighsMipSolverData.h index 07a17e23f6..cbf697fcfc 100644 --- a/src/mip/HighsMipSolverData.h +++ b/src/mip/HighsMipSolverData.h @@ -128,6 +128,46 @@ struct HighsMipSolverData { implications(mipsolver), heuristics(mipsolver), objectiveFunction(mipsolver), + presolve_status(HighsPresolveStatus::kNotSet), + cliquesExtracted(false), + rowMatrixSet(false), + analyticCenterComputed(false), + analyticCenterStatus(HighsModelStatus::kNotset), + detectSymmetries(false), + numRestarts(0), + numRestartsRoot(0), + numCliqueEntriesAfterPresolve(0), + numCliqueEntriesAfterFirstPresolve(0), + feastol(0.0), + epsilon(0.0), + heuristic_effort(0.0), + dispfreq(0), + firstlpsolobj(-kHighsInf), + rootlpsolobj(-kHighsInf), + numintegercols(0), + maxTreeSizeLog2(0), + pruned_treeweight(0), + avgrootlpiters(0.0), + last_disptime(0.0), + firstrootlpiters(0), + num_nodes(0), + num_leaves(0), + num_leaves_before_run(0), + num_nodes_before_run(0), + total_lp_iterations(0), + heuristic_lp_iterations(0), + sepa_lp_iterations(0), + sb_lp_iterations(0), + total_lp_iterations_before_run(0), + heuristic_lp_iterations_before_run(0), + sepa_lp_iterations_before_run(0), + sb_lp_iterations_before_run(0), + num_disp_lines(0), + numImprovingSols(0), + lower_bound(-kHighsInf), + upper_bound(kHighsInf), + upper_limit(kHighsInf), + optimality_limit(kHighsInf), debugSolution(mipsolver) { domain.addCutpool(cutpool); domain.addConflictPool(conflictPool); diff --git a/src/parallel/HighsMutex.h b/src/parallel/HighsMutex.h index cd39788ace..34d8b95541 100644 --- a/src/parallel/HighsMutex.h +++ b/src/parallel/HighsMutex.h @@ -114,7 +114,8 @@ class HighsMutex { } void unlock() { - unsigned int prevState = state.fetch_add(-1, std::memory_order_release); + unsigned int prevState = state.fetch_add( + std::numeric_limits::max(), std::memory_order_release); if (prevState != 1) { unsigned int notifyWorkerId = (prevState >> 1) - 1; diff --git a/src/qpsolver/a_quass.cpp b/src/qpsolver/a_quass.cpp index a8e2583b12..b62d22ebc9 100644 --- a/src/qpsolver/a_quass.cpp +++ b/src/qpsolver/a_quass.cpp @@ -157,7 +157,7 @@ QpAsmStatus solveqp(Instance& instance, } // solve - QpAsmStatus status = solveqp_actual(instance, settings, startinfo, stats, qp_model_status, qp_solution, qp_timer); + solveqp_actual(instance, settings, startinfo, stats, qp_model_status, qp_solution, qp_timer); // undo perturbation and resolve diff --git a/src/qpsolver/steepestedgepricing.hpp b/src/qpsolver/steepestedgepricing.hpp index 0002bd6e13..0a216394ee 100644 --- a/src/qpsolver/steepestedgepricing.hpp +++ b/src/qpsolver/steepestedgepricing.hpp @@ -91,7 +91,6 @@ class SteepestEdgePricing : public Pricing { std::vector correct_weights; std::vector incorrect_weights; - bool ret = true; for (int i=0; isimplexTimerStart(Chuzc4Clock); - bool choose_ok; + bool choose_ok = false; if (use_quad_sort) { // Use the O(n^2) quadratic sort for the candidates analysis->simplexTimerStart(Chuzc4a0Clock); @@ -212,10 +212,10 @@ HighsInt HEkkDualRow::chooseFinal() { // 3. Choose large alpha analysis->simplexTimerStart(Chuzc4bClock); - HighsInt breakIndex; - HighsInt breakGroup; - HighsInt alt_breakIndex; - HighsInt alt_breakGroup; + HighsInt breakIndex = -1; + HighsInt breakGroup = -1; + HighsInt alt_breakIndex = -1; + HighsInt alt_breakGroup = -1; if (use_quad_sort) chooseFinalLargeAlpha(breakIndex, breakGroup, workCount, workData, workGroup); diff --git a/src/simplex/HEkkPrimal.cpp b/src/simplex/HEkkPrimal.cpp index 8c9787cee4..9a258ad90e 100644 --- a/src/simplex/HEkkPrimal.cpp +++ b/src/simplex/HEkkPrimal.cpp @@ -697,7 +697,7 @@ void HEkkPrimal::rebuild() { // basic variables, and baseValue only corresponds to the new // ordering once computePrimal has been called const bool check_updated_objective_value = status.has_primal_objective_value; - double previous_primal_objective_value; + double previous_primal_objective_value = -kHighsInf; if (check_updated_objective_value) { // debugUpdatedObjectiveValue(ekk_instance_, algorithm, solve_phase, // "Before INVERT"); diff --git a/src/util/HFactor.h b/src/util/HFactor.h index a846c9c528..d06a79af67 100644 --- a/src/util/HFactor.h +++ b/src/util/HFactor.h @@ -105,6 +105,35 @@ struct InvertibleRepresentation { */ class HFactor { public: + HFactor() + : build_realTick(0.0), + build_synthetic_tick(0.0), + rank_deficiency(0), + basis_matrix_num_el(0), + invert_num_el(0), + kernel_dim(0), + kernel_num_el(0), + num_row(0), + num_col(0), + num_basic(0), + a_matrix_valid(false), + a_start(nullptr), + a_index(nullptr), + a_value(nullptr), + basic_index(nullptr), + pivot_threshold(0.0), + pivot_tolerance(0.0), + highs_debug_level(0), + time_limit_(0.0), + use_original_HFactor_logic(false), + debug_report_(false), + basis_matrix_limit_size(0), + update_method(0), + build_timer_(nullptr), + nwork(0), + u_merit_x(0), + u_total_x(0){}; + /** * @brief Copy problem size and pointers of constraint matrix, and set * up space for INVERT @@ -304,10 +333,10 @@ class HFactor { RefactorInfo refactor_info_; // Properties of data held in HFactor.h - HighsInt basis_matrix_num_el = 0; - HighsInt invert_num_el = 0; - HighsInt kernel_dim = 0; - HighsInt kernel_num_el = 0; + HighsInt basis_matrix_num_el; + HighsInt invert_num_el; + HighsInt kernel_dim; + HighsInt kernel_num_el; /** * Data of the factor @@ -339,7 +368,7 @@ class HFactor { HighsLogOptions log_options; bool use_original_HFactor_logic; - bool debug_report_ = false; + bool debug_report_; HighsInt basis_matrix_limit_size; HighsInt update_method;