Skip to content

Commit

Permalink
return from reduce split if odd rows
Browse files Browse the repository at this point in the history
  • Loading branch information
jjhforrest committed Mar 15, 2024
1 parent 6df72f9 commit 6851c99
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 7 deletions.
14 changes: 10 additions & 4 deletions src/CglRedSplit/CglRedSplit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1234,7 +1234,12 @@ void CglRedSplit::generateCuts(OsiCuts &cs)
nonBasicAtUpper = new int[ncol+nrow];
nonBasicAtLower = new int[ncol+nrow];
double dist_int;

/*
Even if there are no free variables, clp may mark them as free
if bounds are very large - which might be generated by a badly
scaled problem.
*/
bool goodModel = true;
for(i=0; i<ncol; i++) {
cv_intBasicVar_frac[i] = 0;

Expand Down Expand Up @@ -1295,7 +1300,7 @@ void CglRedSplit::generateCuts(OsiCuts &cs)
printf("### ERROR: CglRedSplit::generateCuts(): cstat[%d]: %d\n",
i, cstat[i]);
#endif
//exit(1);
goodModel = false;
break;
}
}
Expand Down Expand Up @@ -1326,12 +1331,13 @@ void CglRedSplit::generateCuts(OsiCuts &cs)
printf("### ERROR: CglRedSplit::generateCuts(): rstat[%d]: %d\n",
i, rstat[i]);
#endif
//exit(1);
goodModel = false;
break;
}
}

if((card_contNonBasicVar == 0) || (card_intBasicVar_frac == 0)) {
if((card_contNonBasicVar == 0) || (card_intBasicVar_frac == 0)
|| !goodModel) {
delete[] cstat;
delete[] rstat;
delete[] basis_index;
Expand Down
13 changes: 10 additions & 3 deletions src/CglRedSplit2/CglRedSplit2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1651,6 +1651,12 @@ int CglRedSplit2::generateCuts(OsiCuts* cs, int maxNumCuts, int* lambda)
nonBasicAtUpper = new int[ncol+nrow];
nonBasicAtLower = new int[ncol+nrow];
double dist_int;
/*
Even if there are no free variables, clp may mark them as free
if bounds are very large - which might be generated by a badly
scaled problem.
*/
bool goodModel = true;

for(i=0; i<ncol; i++) {
cv_intBasicVar[i] = 0;
Expand Down Expand Up @@ -1716,7 +1722,7 @@ int CglRedSplit2::generateCuts(OsiCuts* cs, int maxNumCuts, int* lambda)
printf("### ERROR: CglRedSplit2::generateCuts(): cstat[%d]: %d\n",
i, cstat[i]);
#endif
//exit(1);
goodModel = false;
break;
}
}
Expand Down Expand Up @@ -1754,7 +1760,7 @@ int CglRedSplit2::generateCuts(OsiCuts* cs, int maxNumCuts, int* lambda)
printf("### ERROR: CglRedSplit::generateCuts(): rstat[%d]: %d\n",
i, rstat[i]);
#endif
//exit(1);
goodModel = false;
break;
}
assert (fabs(effective_rhs[i])<1.0e100);
Expand All @@ -1764,7 +1770,8 @@ int CglRedSplit2::generateCuts(OsiCuts* cs, int maxNumCuts, int* lambda)
printf("CglRedSplit2()::card_intBasicVar_frac %d %d\n",
card_intBasicVar_frac, card_contNonBasicVar);
#endif
if((card_contNonBasicVar == 0) || (card_intBasicVar_frac == 0)) {
if((card_contNonBasicVar == 0) || (card_intBasicVar_frac == 0)
|| !goodModel) {
delete[] cstat;
delete[] rstat;
delete[] basis_index;
Expand Down

0 comments on commit 6851c99

Please sign in to comment.