@@ -2101,16 +2101,13 @@ HighsStatus Highs::getIisInterface() {
21012101 return_status = this ->elasticityFilter (-1.0 , -1.0 , 1.0 , nullptr , nullptr ,
21022102 nullptr , true );
21032103 }
2104- // Do not continue if not using kIisStrategyIrreducible or if time limit is
2105- // reached
2106- if (!(kIisStrategyIrreducible & this ->options_ .iis_strategy ) ||
2107- (this ->iis_ .status_ == kIisModelStatusTimeLimit ))
2104+ // Do not continue if not using kIisStrategyIrreducible
2105+ if (!(kIisStrategyIrreducible & this ->options_ .iis_strategy ))
21082106 return this ->getIisInterfaceReturn (return_status, original_options,
21092107 original_callback_active);
2110-
21112108 // If neither ray and lp options were requested or if they fail to produce a
21122109 // valid IS, make one consisting of all constraints
2113- if (!this ->iis_ .valid_ ) {
2110+ if (!this ->iis_ .valid_ || iis_. status_ != kIisModelStatusReducible ) {
21142111 this ->iis_ .valid_ = true ;
21152112 this ->iis_ .status_ = kIisModelStatusReducible ;
21162113 for (HighsInt iRow = 0 ; iRow < lp.num_row_ ; iRow++)
@@ -2531,11 +2528,12 @@ HighsStatus Highs::elasticityFilter(const double global_lower_penalty,
25312528
25322529 if (write_model) this ->writeModel (" elastic.mps" );
25332530 // Initial logging
2534- if (get_iis)
2531+ if (get_iis) {
25352532 highsLogUser (
25362533 options_.log_options , HighsLogType::kInfo ,
25372534 " Running elasticity filter to identify an infeasible subset of rows\n " );
2538-
2535+ iis.reportIteration (options_, HighsInt (0 ), HighsInt (0 ), true );
2536+ }
25392537 // Working with a copy of the IIS so clear this->iis_
25402538 this ->iis_ .clear ();
25412539 // Lambda for gathering data when solving an LP
@@ -2605,6 +2603,7 @@ HighsStatus Highs::elasticityFilter(const double global_lower_penalty,
26052603 std::unordered_set<HighsInt> row_set;
26062604
26072605 for (;;) {
2606+ loop_k++;
26082607 if (kIisDevReport )
26092608 printf (" \n Elasticity filter pass %d\n ==============\n " , int (loop_k));
26102609 HighsInt num_fixed = 0 ;
@@ -2651,19 +2650,18 @@ HighsStatus Highs::elasticityFilter(const double global_lower_penalty,
26512650 }
26522651 }
26532652 }
2654- // Report on iteration
2655- bool force = loop_k == 0 ;
2656- iis.reportIteration (options_, loop_k + 1 , HighsInt (row_set.size ()), force);
26572653
26582654 if (num_fixed == 0 ) {
26592655 // No elastic variables were positive, so problem is feasible
26602656 iis.status_ = kIisModelStatusFeasible ;
2657+ iis.reportIteration (options_, loop_k, HighsInt (row_set.size ()), true );
26612658 break ;
26622659 }
26632660 HighsStatus run_status = solveLp ();
2661+ HighsModelStatus model_status = this ->getModelStatus ();
26642662 if (run_status != HighsStatus::kOk ) {
26652663 // Solve failed
2666- if (this -> model_status_ == HighsModelStatus::kTimeLimit ) {
2664+ if (model_status == HighsModelStatus::kTimeLimit ) {
26672665 iis.status_ = kIisModelStatusTimeLimit ;
26682666
26692667 highsLogUser (
@@ -2684,14 +2682,10 @@ HighsStatus Highs::elasticityFilter(const double global_lower_penalty,
26842682 original_col_lower, original_col_upper, original_integrality);
26852683 }
26862684 if (kIisDevReport ) this ->writeSolution (" " , kSolutionStylePretty );
2687- HighsModelStatus model_status = this -> getModelStatus ( );
2688- if (model_status == HighsModelStatus:: kInfeasible ) break ;
2689- loop_k++ ;
2685+ bool terminate = (model_status == HighsModelStatus:: kInfeasible );
2686+ iis. reportIteration (options_, loop_k, HighsInt (row_set. size ()), terminate) ;
2687+ if (terminate) break ;
26902688 }
2691-
2692- // Final report
2693- iis.reportIteration (options_, loop_k + 1 , HighsInt (row_set.size ()), true );
2694-
26952689 HighsInt num_enforced_col_ecol = 0 ;
26962690 HighsInt num_enforced_row_ecol = 0 ;
26972691 if (has_elastic_columns) {
@@ -2741,13 +2735,15 @@ HighsStatus Highs::elasticityFilter(const double global_lower_penalty,
27412735 if (iis.status_ == kIisModelStatusFeasible ) {
27422736 assert (num_enforced_col_ecol == 0 && num_enforced_row_ecol == 0 );
27432737 assert (num_iis_row == 0 );
2738+ highsLogUser (options_.log_options , HighsLogType::kInfo ,
2739+ " Elasticity filter failed to reproduce infeasibility\n " );
2740+ } else {
2741+ highsLogUser (options_.log_options , HighsLogType::kInfo ,
2742+ " Elasticity filter after %d passes found an infeasible subset "
2743+ " of %d rows\n " ,
2744+ int (loop_k), row_set.size ());
27442745 }
27452746
2746- highsLogUser (options_.log_options , HighsLogType::kInfo ,
2747- " Elasticity filter after %d passes found an infeasible subset "
2748- " of %d rows\n " ,
2749- int (loop_k + 1 ), row_set.size ());
2750-
27512747 iis.valid_ = true ;
27522748 iis.strategy_ = this ->options_ .iis_strategy ;
27532749 if (iis.status_ == kIisModelStatusFeasible ) {
0 commit comments