Skip to content

Commit 6851c99

Browse files
committed
return from reduce split if odd rows
1 parent 6df72f9 commit 6851c99

File tree

2 files changed

+20
-7
lines changed

2 files changed

+20
-7
lines changed

src/CglRedSplit/CglRedSplit.cpp

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1234,7 +1234,12 @@ void CglRedSplit::generateCuts(OsiCuts &cs)
12341234
nonBasicAtUpper = new int[ncol+nrow];
12351235
nonBasicAtLower = new int[ncol+nrow];
12361236
double dist_int;
1237-
1237+
/*
1238+
Even if there are no free variables, clp may mark them as free
1239+
if bounds are very large - which might be generated by a badly
1240+
scaled problem.
1241+
*/
1242+
bool goodModel = true;
12381243
for(i=0; i<ncol; i++) {
12391244
cv_intBasicVar_frac[i] = 0;
12401245

@@ -1295,7 +1300,7 @@ void CglRedSplit::generateCuts(OsiCuts &cs)
12951300
printf("### ERROR: CglRedSplit::generateCuts(): cstat[%d]: %d\n",
12961301
i, cstat[i]);
12971302
#endif
1298-
//exit(1);
1303+
goodModel = false;
12991304
break;
13001305
}
13011306
}
@@ -1326,12 +1331,13 @@ void CglRedSplit::generateCuts(OsiCuts &cs)
13261331
printf("### ERROR: CglRedSplit::generateCuts(): rstat[%d]: %d\n",
13271332
i, rstat[i]);
13281333
#endif
1329-
//exit(1);
1334+
goodModel = false;
13301335
break;
13311336
}
13321337
}
13331338

1334-
if((card_contNonBasicVar == 0) || (card_intBasicVar_frac == 0)) {
1339+
if((card_contNonBasicVar == 0) || (card_intBasicVar_frac == 0)
1340+
|| !goodModel) {
13351341
delete[] cstat;
13361342
delete[] rstat;
13371343
delete[] basis_index;

src/CglRedSplit2/CglRedSplit2.cpp

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1651,6 +1651,12 @@ int CglRedSplit2::generateCuts(OsiCuts* cs, int maxNumCuts, int* lambda)
16511651
nonBasicAtUpper = new int[ncol+nrow];
16521652
nonBasicAtLower = new int[ncol+nrow];
16531653
double dist_int;
1654+
/*
1655+
Even if there are no free variables, clp may mark them as free
1656+
if bounds are very large - which might be generated by a badly
1657+
scaled problem.
1658+
*/
1659+
bool goodModel = true;
16541660

16551661
for(i=0; i<ncol; i++) {
16561662
cv_intBasicVar[i] = 0;
@@ -1716,7 +1722,7 @@ int CglRedSplit2::generateCuts(OsiCuts* cs, int maxNumCuts, int* lambda)
17161722
printf("### ERROR: CglRedSplit2::generateCuts(): cstat[%d]: %d\n",
17171723
i, cstat[i]);
17181724
#endif
1719-
//exit(1);
1725+
goodModel = false;
17201726
break;
17211727
}
17221728
}
@@ -1754,7 +1760,7 @@ int CglRedSplit2::generateCuts(OsiCuts* cs, int maxNumCuts, int* lambda)
17541760
printf("### ERROR: CglRedSplit::generateCuts(): rstat[%d]: %d\n",
17551761
i, rstat[i]);
17561762
#endif
1757-
//exit(1);
1763+
goodModel = false;
17581764
break;
17591765
}
17601766
assert (fabs(effective_rhs[i])<1.0e100);
@@ -1764,7 +1770,8 @@ int CglRedSplit2::generateCuts(OsiCuts* cs, int maxNumCuts, int* lambda)
17641770
printf("CglRedSplit2()::card_intBasicVar_frac %d %d\n",
17651771
card_intBasicVar_frac, card_contNonBasicVar);
17661772
#endif
1767-
if((card_contNonBasicVar == 0) || (card_intBasicVar_frac == 0)) {
1773+
if((card_contNonBasicVar == 0) || (card_intBasicVar_frac == 0)
1774+
|| !goodModel) {
17681775
delete[] cstat;
17691776
delete[] rstat;
17701777
delete[] basis_index;

0 commit comments

Comments
 (0)