@@ -1251,40 +1251,46 @@ HighsStatus Highs::run() {
12511251 // Run solver.
12521252 bool have_optimal_solution = false ;
12531253 // ToDo Put solution of presolved problem in a separate method
1254-
1254+
12551255 // if (!this->options_.presolve_remove_slacks) {
1256- HighsLp& reduced_lp = presolve_.getReducedProblem ();
1257- HighsInt num_double_slack = 0 ;
1258- HighsInt num_slack = 0 ;
1259- HighsInt num_zero_cost_slack = 0 ;
1260- HighsInt num_unit_coeff_slack = 0 ;
1261- double min_slack_coeff = kHighsInf ;
1262- double max_slack_coeff = -kHighsInf ;
1263- std::vector<bool > found_slack;
1264- found_slack.assign (reduced_lp.num_row_ , false );
1265- for (HighsInt iCol = 0 ; iCol < reduced_lp.num_col_ ; iCol++) {
1266- HighsInt nnz = reduced_lp.a_matrix_ .start_ [iCol+1 ] - reduced_lp.a_matrix_ .start_ [iCol];
1267- if (nnz != 1 ) continue ;
1268- HighsInt iRow = reduced_lp.a_matrix_ .index_ [reduced_lp.a_matrix_ .start_ [iCol]];
1269- if (found_slack[iRow]) {
1270- num_double_slack++;
1271- continue ;
1272- }
1273- if (reduced_lp.row_lower_ [iRow] != reduced_lp.row_upper_ [iRow]) continue ;
1274- num_slack++;
1275- printf (" Column %d is slack\n " , int (iCol));
1276- double coeff = std::fabs (reduced_lp.a_matrix_ .value_ [reduced_lp.a_matrix_ .start_ [iCol]]);
1277- if (coeff == 1.0 ) num_unit_coeff_slack++;
1278- min_slack_coeff = std::min (coeff,min_slack_coeff);
1279- max_slack_coeff = std::max (coeff,max_slack_coeff);
1280- found_slack[iRow] = true ;
1281- if (reduced_lp.col_cost_ [iCol] == 0 ) num_zero_cost_slack++;
1256+ HighsLp& reduced_lp = presolve_.getReducedProblem ();
1257+ HighsInt num_double_slack = 0 ;
1258+ HighsInt num_slack = 0 ;
1259+ HighsInt num_zero_cost_slack = 0 ;
1260+ HighsInt num_unit_coeff_slack = 0 ;
1261+ double min_slack_coeff = kHighsInf ;
1262+ double max_slack_coeff = -kHighsInf ;
1263+ std::vector<bool > found_slack;
1264+ found_slack.assign (reduced_lp.num_row_ , false );
1265+ for (HighsInt iCol = 0 ; iCol < reduced_lp.num_col_ ; iCol++) {
1266+ HighsInt nnz = reduced_lp.a_matrix_ .start_ [iCol + 1 ] -
1267+ reduced_lp.a_matrix_ .start_ [iCol];
1268+ if (nnz != 1 ) continue ;
1269+ HighsInt iRow =
1270+ reduced_lp.a_matrix_ .index_ [reduced_lp.a_matrix_ .start_ [iCol]];
1271+ if (found_slack[iRow]) {
1272+ num_double_slack++;
1273+ continue ;
12821274 }
1283- printf (" grepSlack,model,col,slack,unit coeff,zero_cost,double,min coeff, max_coeff\n " );
1284- printf (" grepSlack,%s,%d, %d, %d, %d, %d, %g, %g\n " , this ->model_ .lp_ .model_name_ .c_str (),
1285- int (reduced_lp.num_col_ ), int (num_slack), int (num_unit_coeff_slack), int (num_zero_cost_slack), int (num_double_slack),
1286- min_slack_coeff, max_slack_coeff);
1287- // }
1275+ if (reduced_lp.row_lower_ [iRow] != reduced_lp.row_upper_ [iRow]) continue ;
1276+ num_slack++;
1277+ printf (" Column %d is slack\n " , int (iCol));
1278+ double coeff = std::fabs (
1279+ reduced_lp.a_matrix_ .value_ [reduced_lp.a_matrix_ .start_ [iCol]]);
1280+ if (coeff == 1.0 ) num_unit_coeff_slack++;
1281+ min_slack_coeff = std::min (coeff, min_slack_coeff);
1282+ max_slack_coeff = std::max (coeff, max_slack_coeff);
1283+ found_slack[iRow] = true ;
1284+ if (reduced_lp.col_cost_ [iCol] == 0 ) num_zero_cost_slack++;
1285+ }
1286+ printf (
1287+ " grepSlack,model,col,slack,unit coeff,zero_cost,double,min coeff, "
1288+ " max_coeff\n " );
1289+ printf (" grepSlack,%s,%d, %d, %d, %d, %d, %g, %g\n " ,
1290+ this ->model_ .lp_ .model_name_ .c_str (), int (reduced_lp.num_col_ ),
1291+ int (num_slack), int (num_unit_coeff_slack), int (num_zero_cost_slack),
1292+ int (num_double_slack), min_slack_coeff, max_slack_coeff);
1293+ // }
12881294
12891295 switch (model_presolve_status_) {
12901296 case HighsPresolveStatus::kNotPresolved : {
@@ -1310,7 +1316,7 @@ HighsStatus Highs::run() {
13101316 break ;
13111317 }
13121318 case HighsPresolveStatus::kReduced : {
1313- HighsLp& reduced_lp = presolve_.getReducedProblem ();
1319+ HighsLp& reduced_lp = presolve_.getReducedProblem ();
13141320 reduced_lp.setMatrixDimensions ();
13151321 if (kAllowDeveloperAssert ) {
13161322 // Validate the reduced LP
0 commit comments