Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion check/TestHighsParallel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,9 @@ TEST_CASE("ParallelSchedulerIsPerThread", "[parallel]") {
REQUIRE(b.threads_after_reset == num_threads_B);
REQUIRE(b.sum_after_reset == expected_sum);

HighsTaskExecutor::shutdown(true);

// A really was reset
REQUIRE(a.threads_after_reset == num_threads_A_second);
REQUIRE(a.sum_after_reset == expected_sum);
}
}
21 changes: 19 additions & 2 deletions check/TestLpSolvers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,8 @@ void testStandardForm(const HighsLp& lp) {
Highs highs;
highs.setOptionValue("output_flag", dev_run);
HighsInt sense = HighsInt(lp.sense_);
highs.passModel(lp);
highs.run();
REQUIRE(highs.passModel(lp) == HighsStatus::kOk);
REQUIRE(highs.run() == HighsStatus::kOk);
// highs.writeSolution("", kSolutionStylePretty);
double required_objective_function_value =
highs.getInfo().objective_function_value;
Expand Down Expand Up @@ -366,6 +366,23 @@ TEST_CASE("standard-form-lp", "[highs_lp_solver]") {
highs.resetThreadScheduler(true);
}

TEST_CASE("standard-form-empty-lp", "[highs_lp_solver]") {
// Exposed that standard_form_valid_ was not initialised if a model
// had not been loaded - ie empty or built
Highs h;
h.setOptionValue("output_flag", dev_run);

HighsInt num_col;
HighsInt num_row;
HighsInt num_nz;
double offset;
REQUIRE(h.getStandardFormLp(num_col, num_row, num_nz, offset) ==
HighsStatus::kOk);
REQUIRE(num_col == 0);
REQUIRE(num_row == 0);
REQUIRE(num_nz == 0);
}

TEST_CASE("simplex-stats", "[highs_lp_solver]") {
Highs h;
const HighsSimplexStats& simplex_stats = h.getSimplexStats();
Expand Down
2 changes: 1 addition & 1 deletion highs/Highs.h
Original file line number Diff line number Diff line change
Expand Up @@ -1649,7 +1649,7 @@ class Highs {
HighsPresolveStatus::kNotPresolved;
HighsModelStatus model_status_ = HighsModelStatus::kNotset;

bool standard_form_valid_;
bool standard_form_valid_ = false;
double standard_form_offset_;
std::vector<double> standard_form_cost_;
std::vector<double> standard_form_rhs_;
Expand Down
2 changes: 1 addition & 1 deletion highs/lp_data/HighsInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class InfoRecordDouble : public InfoRecord {
// todo: when creating the new info don't forget underscores for class
// variables but no underscores for struct
struct HighsInfoStruct {
bool valid;
bool valid = false;
int64_t mip_node_count;
HighsInt simplex_iteration_count;
HighsInt ipm_iteration_count;
Expand Down
2 changes: 1 addition & 1 deletion highs/util/HVectorBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class HVectorBase {
*/
void reIndex();

bool packFlag; //!< Flag to indicate whether to pack or not
bool packFlag = false; //!< Flag to indicate whether to pack or not
HighsInt packCount; //!< Number of nonzeros packed
vector<HighsInt> packIndex; //!< Packed indices
vector<Real> packValue; //!< Packed values
Expand Down
Loading