@@ -502,14 +502,45 @@ void HighsIis::setStatus(const HighsLp& lp) {
502502 this ->row_status_ [this ->row_index_ [iisRow]] = in_is_status;
503503}
504504
505+ HighsInt HighsIis::determineBoundStatus (const double lower, const double upper,
506+ const bool is_row) const {
507+ HighsInt iss_bound_status = kIisBoundStatusNull ;
508+ if (lower <= -kHighsInf ) {
509+ if (upper >= kHighsInf ) {
510+ if (is_row) {
511+ // Free rows can be dropped
512+ iss_bound_status = kIisBoundStatusDropped ;
513+ } else {
514+ // Free columns can only be dropped if they are empty
515+ iss_bound_status = kIisBoundStatusFree ;
516+ }
517+ } else {
518+ iss_bound_status = kIisBoundStatusUpper ;
519+ }
520+ } else {
521+ if (upper >= kHighsInf ) {
522+ iss_bound_status = kIisBoundStatusLower ;
523+ } else {
524+ // FX or BX
525+ iss_bound_status = kIisBoundStatusBoxed ;
526+ }
527+ }
528+ assert (iss_bound_status != kIisBoundStatusNull );
529+ return iss_bound_status;
530+ }
531+
505532HighsStatus HighsIis::compute (const HighsLp& lp, const HighsOptions& options,
506533 const HighsBasis* basis) {
507534 const HighsLogOptions& log_options = options.log_options ;
508535 const bool col_priority = kIisStrategyColPriority & options.iis_strategy ;
509536 const bool row_priority = !col_priority;
510537 // Initially all columns and rows are candidates for the IIS
511- for (HighsInt iCol = 0 ; iCol < lp.num_col_ ; iCol++) this ->addCol (iCol);
512- for (HighsInt iRow = 0 ; iRow < lp.num_row_ ; iRow++) this ->addRow (iRow);
538+ for (HighsInt iCol = 0 ; iCol < lp.num_col_ ; iCol++)
539+ this ->addCol (iCol, this ->determineBoundStatus (lp.col_lower_ [iCol],
540+ lp.col_upper_ [iCol], false ));
541+ for (HighsInt iRow = 0 ; iRow < lp.num_row_ ; iRow++)
542+ this ->addRow (iRow, this ->determineBoundStatus (lp.row_lower_ [iRow],
543+ lp.row_upper_ [iRow], true ));
513544 Highs highs;
514545 const HighsInfo& info = highs.getInfo ();
515546 highs.passOptions (options);
@@ -644,8 +675,12 @@ HighsStatus HighsIis::compute(const HighsLp& lp, const HighsOptions& options,
644675 run_status = solveLp ();
645676 // If we fail to establish infeasibility, return the initial subset
646677 if (run_status != HighsStatus::kOk ) {
678+ this ->valid_ = true ;
679+ this ->strategy_ = options.iis_strategy ;
647680 if (highs.getModelStatus () == HighsModelStatus::kTimeLimit ) {
648681 this ->status_ = IisModelStatus::kIisModelStatusTimeLimit ;
682+ } else {
683+ this ->status_ = IisModelStatus::kIisModelStatusReducible ;
649684 }
650685 return HighsStatus::kWarning ;
651686 }
@@ -669,8 +704,8 @@ HighsStatus HighsIis::compute(const HighsLp& lp, const HighsOptions& options,
669704 continue ;
670705 double lower = row_deletion ? lp.row_lower_ [iX] : lp.col_lower_ [iX];
671706 double upper = row_deletion ? lp.row_upper_ [iX] : lp.col_upper_ [iX];
672- // Record whether the upper bound has been dropped due to the lower bound
673- // being kept
707+ // Record whether the upper bound has been dropped due to the lower
708+ // bound being kept
674709 if (lower > -kHighsInf && iis_status != kIisModelStatusTimeLimit ) {
675710 // Drop the lower bound temporarily
676711 bool drop_lower = true ;
@@ -713,28 +748,8 @@ HighsStatus HighsIis::compute(const HighsLp& lp, const HighsOptions& options,
713748 assert (check_lower == lower);
714749 assert (check_upper == upper);
715750 }
716- HighsInt iss_bound_status = kIisBoundStatusNull ;
717- if (lower <= -kHighsInf ) {
718- if (upper >= kHighsInf ) {
719- if (row_deletion) {
720- // Free rows can be dropped
721- iss_bound_status = kIisBoundStatusDropped ;
722- } else {
723- // Free columns can only be dropped if they are empty
724- iss_bound_status = kIisBoundStatusFree ;
725- }
726- } else {
727- iss_bound_status = kIisBoundStatusUpper ;
728- }
729- } else {
730- if (upper >= kHighsInf ) {
731- iss_bound_status = kIisBoundStatusLower ;
732- } else {
733- // FX or BX
734- iss_bound_status = kIisBoundStatusBoxed ;
735- }
736- }
737- assert (iss_bound_status != kIisBoundStatusNull );
751+ HighsInt iss_bound_status =
752+ this ->determineBoundStatus (lower, upper, row_deletion);
738753 if (row_deletion) {
739754 this ->row_bound_ [iX] = iss_bound_status;
740755 } else {
0 commit comments