Skip to content

Commit 86f76b4

Browse files
committed
check sol to ekk, still have to test
1 parent 3420ad1 commit 86f76b4

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-0
lines changed

check/TestCheckSolution.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ TEST_CASE("check-solution", "[highs_check_solution]") {
6868
// Second pass uses sparse format
6969
write_solution_style = kSolutionStyleSparse;
7070
}
71+
72+
highs.resetGlobalScheduler(true);
7173
}
7274

7375
TEST_CASE("check-set-mip-solution", "[highs_check_solution]") {
@@ -288,6 +290,8 @@ TEST_CASE("check-set-mip-solution", "[highs_check_solution]") {
288290
}
289291
assert(other_tests);
290292
std::remove(solution_file.c_str());
293+
294+
highs.resetGlobalScheduler(true);
291295
}
292296

293297
TEST_CASE("set-pathological-solution", "[highs_check_solution]") {
@@ -314,6 +318,8 @@ TEST_CASE("set-pathological-solution", "[highs_check_solution]") {
314318
highs.setSolution(solution);
315319
highs.run();
316320
REQUIRE(highs.getModelStatus() == HighsModelStatus::kUnbounded);
321+
322+
highs.resetGlobalScheduler(true);
317323
}
318324

319325
TEST_CASE("check-set-lp-solution", "[highs_check_solution]") {
@@ -357,6 +363,8 @@ TEST_CASE("check-set-rowwise-lp-solution", "[highs_check_solution]") {
357363
highs.run();
358364
double objective2 = highs.getInfo().objective_function_value;
359365
REQUIRE(fabs(objective1 - objective2) / max(1.0, objective1) < 1e-5);
366+
367+
highs.resetGlobalScheduler(true);
360368
}
361369

362370
TEST_CASE("check-set-mip-solution-extra-row", "[highs_check_solution]") {
@@ -387,6 +395,8 @@ TEST_CASE("check-set-mip-solution-extra-row", "[highs_check_solution]") {
387395
highs.run();
388396
if (dev_run) highs.writeSolution("", 1);
389397
std::remove(solution_file_name.c_str());
398+
399+
highs.resetGlobalScheduler(true);
390400
}
391401

392402
TEST_CASE("check-set-illegal-solution", "[highs_check_solution]") {
@@ -400,6 +410,8 @@ TEST_CASE("check-set-illegal-solution", "[highs_check_solution]") {
400410
REQUIRE(highs.setSolution(solution) == HighsStatus::kError);
401411
solution.col_value.assign(lp.num_col_, 0);
402412
REQUIRE(highs.setSolution(solution) == HighsStatus::kOk);
413+
414+
highs.resetGlobalScheduler(true);
403415
}
404416

405417
TEST_CASE("read-miplib-solution", "[highs_check_solution]") {
@@ -447,6 +459,8 @@ TEST_CASE("read-miplib-solution", "[highs_check_solution]") {
447459
REQUIRE(h.readSolution(miplib_sol_file) == HighsStatus::kOk);
448460
REQUIRE(h.run() == HighsStatus::kOk);
449461
std::remove(miplib_sol_file.c_str());
462+
463+
h.resetGlobalScheduler(true);
450464
}
451465

452466
void runWriteReadCheckSolution(Highs& highs, const std::string& test_name,
@@ -499,6 +513,8 @@ void runWriteReadCheckSolution(Highs& highs, const std::string& test_name,
499513
REQUIRE(status == require_model_status);
500514

501515
std::remove(solution_file.c_str());
516+
517+
highs.resetGlobalScheduler(true);
502518
}
503519

504520
void runSetLpSolution(const std::string model) {
@@ -566,4 +582,6 @@ void runSetLpSolution(const std::string model) {
566582
highs.clear();
567583

568584
std::remove(solution_file.c_str());
585+
586+
highs.resetGlobalScheduler(true);
569587
}

check/TestCrossover.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,10 @@ void test_crossover(Highs& highs, HighsLp& lp) {
9191
}
9292
report("After crossover", lp, solution, basis);
9393
report("From Highs", lp, highs.getSolution(), highs.getBasis());
94+
95+
highs.resetGlobalScheduler(true);
9496
}
97+
9598
void report(const std::string message, const HighsLp& lp,
9699
const HighsSolution& solution, const HighsBasis& basis) {
97100
if (!dev_run) return;

check/TestEkk.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ void ekk_solve(Highs& highs, std::string presolve,
3131

3232
REQUIRE(highs.resetOptions() == HighsStatus::kOk);
3333
highs.setOptionValue("output_flag", dev_run);
34+
35+
highs.resetGlobalScheduler(true);
3436
}
3537

3638
void ekk_distillation(Highs& highs) {
@@ -85,6 +87,8 @@ TEST_CASE("Ekk", "[highs_test_ekk]") {
8587
ekk_blending(highs);
8688
// ekk_scipLpi3(highs);
8789
}
90+
91+
highs.resetGlobalScheduler(true);
8892
}
8993

9094
TEST_CASE("EkkPrimal-all", "[highs_test_ekk]") {

0 commit comments

Comments
 (0)