Skip to content

Commit b31c2c9

Browse files
committed
up to LpValidation
1 parent 7288a05 commit b31c2c9

15 files changed

+111
-0
lines changed

check/TestHighsModel.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ TEST_CASE("highs-model", "[highs_model]") {
7575
REQUIRE(status == HighsStatus::kOk);
7676
status = highs.run();
7777
REQUIRE(status == HighsStatus::kError);
78+
79+
highs.resetGlobalScheduler(true);
7880
}
7981

8082
TEST_CASE("highs-integrality", "[highs_model]") {
@@ -127,4 +129,6 @@ TEST_CASE("highs-integrality", "[highs_model]") {
127129

128130
REQUIRE(highs.getColIntegrality(0, integrality) == HighsStatus::kOk);
129131
REQUIRE(integrality == HighsVarType::kInteger);
132+
133+
highs.resetGlobalScheduler(true);
130134
}

check/TestHighsSparseMatrix.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,4 +123,6 @@ TEST_CASE("Sparse-matrix-products", "[highs_sparse_matrix]") {
123123

124124
highs.clear();
125125
}
126+
127+
highs.resetGlobalScheduler(true);
126128
}

check/TestHighsVersion.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,6 @@ TEST_CASE("sizeof-highs-int", "[highs_version]") {
5858
#else
5959
REQUIRE(sizeof_highs_int == 4);
6060
#endif
61+
62+
highs.resetGlobalScheduler(true);
6163
}

check/TestICrash.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,6 @@ TEST_CASE("icrash-qap04", "[highs_presolve]") {
4141
// assert residual is below threshold
4242
REQUIRE(info.final_residual_norm_2 >= -1e08);
4343
REQUIRE(info.final_residual_norm_2 < 1e08);
44+
45+
highs.resetGlobalScheduler(true);
4446
}

check/TestIO.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ TEST_CASE("run-callback", "[highs_io]") {
3737
// highs.setLogCallback(userLogCallback);
3838
highs.readModel(filename);
3939
highs.run();
40+
41+
highs.resetGlobalScheduler(true);
4042
}
4143

4244
TEST_CASE("log-callback", "[highs_io]") {

check/TestIis.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ TEST_CASE("lp-incompatible-bounds", "[iis]") {
5757
REQUIRE(iis.row_index_.size() == 0);
5858
REQUIRE(iis.col_index_[0] == 2);
5959
REQUIRE(iis.col_bound_[0] == kIisBoundStatusBoxed);
60+
61+
highs.resetGlobalScheduler(true);
6062
}
6163

6264
TEST_CASE("lp-empty-infeasible-row", "[iis]") {
@@ -93,6 +95,8 @@ TEST_CASE("lp-empty-infeasible-row", "[iis]") {
9395
REQUIRE(iis.row_index_.size() == 1);
9496
REQUIRE(iis.row_index_[0] == empty_row);
9597
REQUIRE(iis.row_bound_[0] == kIisBoundStatusUpper);
98+
99+
highs.resetGlobalScheduler(true);
96100
}
97101

98102
TEST_CASE("lp-get-iis", "[iis]") {
@@ -123,6 +127,8 @@ TEST_CASE("lp-get-iis", "[iis]") {
123127
REQUIRE(iis.col_index_[0] == 0);
124128
REQUIRE(iis.col_index_[1] == 1);
125129
REQUIRE(iis.row_index_[0] == 2);
130+
131+
highs.resetGlobalScheduler(true);
126132
}
127133

128134
TEST_CASE("lp-get-iis-woodinfe", "[iis]") {
@@ -294,6 +300,8 @@ TEST_CASE("lp-feasibility-relaxation", "[iis]") {
294300
testFeasibilityRelaxation(model, 1, 1, 1, 15.0);
295301
model = "avgas";
296302
testFeasibilityRelaxation(model, 1, 1, 1, 0);
303+
304+
h.resetGlobalScheduler(true);
297305
}
298306

299307
void testIis(const std::string& model, const HighsIis& iis) {
@@ -414,6 +422,8 @@ void testIis(const std::string& model, const HighsIis& iis) {
414422
REQUIRE(model_status == HighsModelStatus::kOptimal);
415423
REQUIRE(highs.changeRowBounds(iRow, lower, upper) == HighsStatus::kOk);
416424
}
425+
426+
highs.resetGlobalScheduler(true);
417427
}
418428

419429
void testMps(std::string& model, const HighsInt iis_strategy,
@@ -447,6 +457,8 @@ void testMps(std::string& model, const HighsInt iis_strategy,
447457
REQUIRE(num_iis_col == 0);
448458
REQUIRE(num_iis_row == 0);
449459
}
460+
461+
highs.resetGlobalScheduler(true);
450462
}
451463

452464
void testFeasibilityRelaxation(
@@ -462,4 +474,6 @@ void testFeasibilityRelaxation(
462474
HighsStatus::kOk);
463475
REQUIRE(h.getInfo().objective_function_value ==
464476
require_feasibility_objective_function_value);
477+
478+
h.resetGlobalScheduler(true);
465479
}

check/TestInfo.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,4 +102,6 @@ TEST_CASE("highs-info", "[highs_info]") {
102102
highs_info.ipm_iteration_count);
103103
}
104104
std::remove(highs_info_file.c_str());
105+
106+
highs.resetGlobalScheduler(true);
105107
}

check/TestIpm.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ TEST_CASE("test-analytic-centre", "[highs_ipm]") {
2323
highs.setOptionValue("ipm_optimality_tolerance", 1e-2);
2424
HighsStatus run_status = highs.run();
2525
REQUIRE(run_status == HighsStatus::kOk);
26+
27+
highs.resetGlobalScheduler(true);
2628
}
2729

2830
TEST_CASE("test-analytic-centre-infeasible", "[highs_ipm]") {
@@ -46,6 +48,8 @@ TEST_CASE("test-analytic-centre-infeasible", "[highs_ipm]") {
4648
HighsStatus run_status = highs.run();
4749
REQUIRE(run_status == HighsStatus::kOk);
4850
REQUIRE(highs.getModelStatus() == HighsModelStatus::kInfeasible);
51+
52+
highs.resetGlobalScheduler(true);
4953
}
5054

5155
TEST_CASE("test-analytic-centre-box", "[highs_ipm]") {
@@ -80,6 +84,8 @@ TEST_CASE("test-analytic-centre-box", "[highs_ipm]") {
8084
}
8185
REQUIRE(solution_norm < 1e-6);
8286
if (dev_run) printf("Analytic centre solution norm is %g\n", solution_norm);
87+
88+
highs.resetGlobalScheduler(true);
8389
}
8490

8591
TEST_CASE("test-1966", "[highs_ipm]") {
@@ -133,6 +139,8 @@ TEST_CASE("test-1966", "[highs_ipm]") {
133139
printf("Max dual infeasibility = %g\n", info.max_dual_infeasibility);
134140
printf("Sum dual infeasibilities = %g\n", info.sum_dual_infeasibilities);
135141
}
142+
143+
highs.resetGlobalScheduler(true);
136144
}
137145

138146
TEST_CASE("test-2087", "[highs_ipm]") {
@@ -152,4 +160,7 @@ TEST_CASE("test-2087", "[highs_ipm]") {
152160

153161
h.run();
154162
REQUIRE(first_ipm_iteration_count == h.getInfo().ipm_iteration_count);
163+
164+
h.resetGlobalScheduler(true);
165+
155166
}

check/TestLPFileFormat.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,6 @@ TEST_CASE("lp-file-format-quad-no-space", "[LpFileFormat]") {
1919
REQUIRE(highs.readModel(filename) == HighsStatus::kError);
2020

2121
// todo: read the coefficients/variables off the highs model
22+
23+
highs.resetGlobalScheduler(true);
2224
}

check/TestLogging.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ TEST_CASE("logging", "[highs_logging]") {
4444
highs.run();
4545

4646
if (!dev_run) std::remove(log_file.c_str());
47+
48+
highs.resetGlobalScheduler(true);
4749
}
4850

4951
TEST_CASE("no-logging", "[highs_logging]") {
@@ -62,4 +64,6 @@ TEST_CASE("no-logging", "[highs_logging]") {
6264

6365
return_status = highs.run();
6466
REQUIRE(return_status == HighsStatus::kOk);
67+
68+
highs.resetGlobalScheduler(true);
6569
}

0 commit comments

Comments
 (0)