@@ -1848,6 +1848,10 @@ HighsStatus Highs::getIisInterfaceReturn(const HighsStatus return_status) {
18481848 // is any bound is relaxed)
18491849 bool lp_ok = this ->iis_ .lpOk (this ->options_ );
18501850 if (!lp_ok) return HighsStatus::kError ;
1851+ } else {
1852+ assert (!this ->iis_ .irreducible_ );
1853+ assert (!this ->iis_ .col_bound_ .size ());
1854+ assert (!this ->iis_ .row_bound_ .size ());
18511855 }
18521856 // Construct the ISS status vectors for cols and rows of original
18531857 // model
@@ -1942,7 +1946,6 @@ HighsStatus Highs::getIisInterface() {
19421946 highsLogUser (
19431947 options_.log_options , HighsLogType::kWarning ,
19441948 " No known dual ray from which to compute IIS: using whole model\n " );
1945- std::vector<HighsInt> infeasible_row_subset;
19461949 if (ray_option && has_dual_ray) {
19471950 // Compute the dual ray to identify an infeasible subset of rows
19481951 assert (ekk_instance_.status_ .has_invert );
@@ -1956,7 +1959,7 @@ HighsStatus Highs::getIisInterface() {
19561959 basisSolveInterface (rhs, dual_ray_value.data (), dual_ray_num_nz, NULL ,
19571960 true );
19581961 for (HighsInt iRow = 0 ; iRow < lp.num_row_ ; iRow++)
1959- if (dual_ray_value[iRow]) infeasible_row_subset .push_back (iRow);
1962+ if (dual_ray_value[iRow]) this -> iis_ . row_index_ .push_back (iRow);
19601963 } else {
19611964 // Full LP option chosen or no dual ray to use
19621965 //
@@ -1967,15 +1970,14 @@ HighsStatus Highs::getIisInterface() {
19671970 // Apply the elasticity filter to the whole model in order to
19681971 // determine an infeasible subset of rows
19691972 HighsStatus return_status =
1970- this ->elasticityFilter (-1.0 , -1.0 , 1.0 , nullptr , nullptr , nullptr , true ,
1971- infeasible_row_subset);
1973+ this ->elasticityFilter (-1.0 , -1.0 , 1.0 , nullptr , nullptr , nullptr , true );
19721974 HighsLp check_lp_after = this ->model_ .lp_ ;
19731975 assert (check_lp_before.equalVectors (check_lp_after));
19741976 assert (check_lp_before.a_matrix_ .equivalent (check_lp_after.a_matrix_ ));
19751977 if (return_status != HighsStatus::kOk ) return return_status;
19761978 }
19771979 return_status = HighsStatus::kOk ;
1978- if (infeasible_row_subset .size () == 0 ) {
1980+ if (this -> iis_ . row_index_ .size () == 0 ) {
19791981 // No subset of infeasible rows, so model is feasible
19801982 this ->iis_ .valid_ = true ;
19811983 assert (!this ->iis_ .irreducible_ );
@@ -1991,7 +1993,7 @@ HighsStatus Highs::getIisInterface() {
19911993 // To get the IIS data needs the matrix to be column-wise
19921994 model_.lp_ .a_matrix_ .ensureColwise ();
19931995 return_status =
1994- this ->iis_ .deduce (lp, options_, basis_, infeasible_row_subset );
1996+ this ->iis_ .deduce (lp, options_, basis_);
19951997 if (return_status == HighsStatus::kOk ) {
19961998 // Existence of non-empty IIS => infeasibility
19971999 if (this ->iis_ .col_index_ .size () > 0 || this ->iis_ .row_index_ .size () > 0 )
@@ -2096,12 +2098,11 @@ HighsStatus Highs::elasticityFilter(
20962098 const double global_lower_penalty, const double global_upper_penalty,
20972099 const double global_rhs_penalty, const double * local_lower_penalty,
20982100 const double * local_upper_penalty, const double * local_rhs_penalty,
2099- const bool get_infeasible_row,
2100- std::vector<HighsInt>& infeasible_row_subset) {
2101+ const bool get_iis) {
21012102 // this->writeModel("infeasible.mps");
21022103 //
21032104 // Solve the feasibility relaxation problem for the given penalties,
2104- // continuing to act as the elasticity filter if get_infeasible_row
2105+ // continuing to act as the elasticity filter if get_iis
21052106 // is true, resulting in an infeasibility subset for further
21062107 // refinement as an IIS
21072108 //
@@ -2164,7 +2165,7 @@ HighsStatus Highs::elasticityFilter(
21642165 run_status = this ->changeColsCost (0 , lp.num_col_ - 1 , zero_costs.data ());
21652166 assert (run_status == HighsStatus::kOk );
21662167
2167- const bool mip_relaxation_iis = get_infeasible_row && lp.isMip () &&
2168+ const bool mip_relaxation_iis = get_iis && lp.isMip () &&
21682169 kIisStrategyRelaxation & this ->options_ .iis_strategy ;
21692170 if (mip_relaxation_iis) {
21702171 // Set any integrality to continuous
@@ -2419,7 +2420,7 @@ HighsStatus Highs::elasticityFilter(
24192420 assert (this ->model_status_ == HighsModelStatus::kOptimal ||
24202421 this ->model_status_ == HighsModelStatus::kUnbounded );
24212422
2422- if (!get_infeasible_row )
2423+ if (!get_iis )
24232424 return elasticityFilterReturn (HighsStatus::kOk , false , original_model_name,
24242425 original_num_col, original_num_row,
24252426 original_col_cost, original_col_lower,
@@ -2485,7 +2486,7 @@ HighsStatus Highs::elasticityFilter(
24852486 loop_k++;
24862487 }
24872488
2488- infeasible_row_subset .clear ();
2489+ this -> iis_ .clear ();
24892490 HighsInt num_enforced_col_ecol = 0 ;
24902491 HighsInt num_enforced_row_ecol = 0 ;
24912492 if (has_elastic_columns) {
@@ -2507,7 +2508,12 @@ HighsStatus Highs::elasticityFilter(
25072508 HighsInt iRow = row_of_ecol[eCol];
25082509 if (lp.col_upper_ [row_ecol_offset + eCol] == 0 ) {
25092510 num_enforced_row_ecol++;
2510- infeasible_row_subset.push_back (iRow);
2511+ this ->iis_ .row_index_ .push_back (iRow);
2512+ /*
2513+ this->iis_.row_bound_.push_back(erow_value[eRow] > 0 ?
2514+ kIisBoundStatusUpper :
2515+ kIisBoundStatusLower);
2516+ */
25112517 if (kIisDevReport )
25122518 printf (
25132519 " Row e-col %2d (column %2d) corresponds to row %2d with bound "
@@ -2517,8 +2523,25 @@ HighsStatus Highs::elasticityFilter(
25172523 }
25182524 }
25192525 }
2526+ HighsInt num_iis_row = this ->iis_ .row_index_ .size ();
2527+ /*
2528+ assert(row_of_ecol.size() == num_iis_row);
2529+ std::vector<HighsInt> erow_of_row.assign(lp.num_row_, -1);
2530+ for (HighsInt iX = 0; iX < num_iis_row; iX++) {
2531+ HighsInt iRow =
2532+ if (lp.a_matrix_.isColwise()) {
2533+ for (HighsInt iCol =
2534+ }
2535+ */
25202536 if (feasible_model)
25212537 assert (num_enforced_col_ecol == 0 && num_enforced_row_ecol == 0 );
2538+ HighsIis& iis = this ->iis_ ;
2539+ printf (" After elasticity filter num_enforced_col_ecol = %d; num_enforced_row_ecol = %d\n " ,
2540+ int (num_enforced_col_ecol),
2541+ int (num_enforced_row_ecol));
2542+ if (!feasible_model) this ->model_status_ = HighsModelStatus::kInfeasible ;
2543+ iis.valid_ = true ;
2544+ iis.irreducible_ = false ;
25222545
25232546 highsLogUser (
25242547 options_.log_options , HighsLogType::kInfo ,
0 commit comments