Skip to content

Commit 26ea7e4

Browse files
author
hbagheri
committed
Fixed test failure in TestIis.cpp
1 parent 7b294ba commit 26ea7e4

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

check/TestIis.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -461,9 +461,9 @@ TEST_CASE("lp-get-iis-galenet", "[iis]") {
461461

462462
TEST_CASE("lp-get-iis-avgas", "[iis]") {
463463
std::string model = "avgas";
464-
// For the whole LP calculation the elasticity filter only
465-
// identified feasibility, so the model status is not set
466-
testMps(model, kIisStrategyFromLp, HighsModelStatus::kNotset);
464+
// For the whole LP calculation feasibility is established prior to elasticity
465+
// filter so the model status will be optimal
466+
testMps(model, kIisStrategyFromLp, HighsModelStatus::kOptimal);
467467
// For the ray calculation the model is solved, so its status is
468468
// known
469469
// testMps(model, kIisStrategyFromRay,

highs/lp_data/HighsInterface.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1935,6 +1935,8 @@ HighsStatus Highs::getIisInterface() {
19351935
// light strategy
19361936
if (options_.iis_strategy == kIisStrategyLight)
19371937
return this->getIisInterfaceReturn(HighsStatus::kOk, options_, callback_);
1938+
// Clear IIS
1939+
this->iis_.clear();
19381940
// Save original options and callback
19391941
HighsOptions original_options = this->options_;
19401942
HighsCallback original_callback = this->callback_;
@@ -1994,11 +1996,9 @@ HighsStatus Highs::getIisInterface() {
19941996

19951997
// Construct an IS from ray or lp
19961998
bool ray_option =
1997-
// (kIisStrategyFromRay & options_.iis_strategy) ||
1998-
// (kIisStrategyIrreducible & options_.iis_strategy)
1999+
// kIisStrategyFromRay & options_.iis_strategy;
19992000
false;
2000-
const bool lp_option = (kIisStrategyFromLp & options_.iis_strategy) ||
2001-
(kIisStrategyIrreducible & options_.iis_strategy);
2001+
const bool lp_option = kIisStrategyFromLp & options_.iis_strategy;
20022002
if (ray_option && !ekk_instance_.status_.has_invert) {
20032003
// Model is known to be infeasible, and a dual ray option is
20042004
// chosen, but it has no INVERT, presumably because infeasibility
@@ -2074,8 +2074,8 @@ HighsStatus Highs::getIisInterface() {
20742074
return this->getIisInterfaceReturn(return_status, original_options,
20752075
original_callback);
20762076

2077-
// If both ray and lp options fail to produce a valid IS, make one consisting
2078-
// of all constraints
2077+
// If neither ray and lp options were requested or if they fail to produce a
2078+
// valid IS, make one consisting of all constraints
20792079
if (!this->iis_.valid_) {
20802080
this->iis_.valid_ = true;
20812081
this->iis_.status_ = kIisModelStatusReducible;

0 commit comments

Comments
 (0)