Skip to content

Commit 39eae0c

Browse files
committed
fix wrong assert
1 parent f72c1cf commit 39eae0c

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

src/ClpSimplex.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -11454,7 +11454,7 @@ int ClpSimplex::fathom(void *stuff)
1145411454
int *whichColumn = new int[2 * numberColumns_];
1145511455
int nBound;
1145611456
bool tightenBounds = ((specialOptions_ & 64) == 0) ? false : true;
11457-
//numberRows_=-numberRows_;//!! flag to say do more work (if test in crunch)
11457+
numberRows_=-numberRows_;//!! flag to say do more work (if test in crunch)
1145811458
ClpSimplex *small = static_cast< ClpSimplexOther * >(this)->crunch(rhs, whichRow, whichColumn,
1145911459
nBound, false, tightenBounds);
1146011460
if (small) {
@@ -12177,7 +12177,7 @@ int ClpSimplex::fathomMany(void *stuff)
1217712177
int *whichRow = new int[3 * numberRows_];
1217812178
int *whichColumn = new int[2 * numberColumns_];
1217912179
int nBound;
12180-
//numberRows_=-numberRows_;//!! flag to say do more work (if test in crunch)
12180+
numberRows_=-numberRows_;//!! flag to say do more work (if test in crunch)
1218112181
bool tightenBounds = ((specialOptions_ & 64) == 0) ? false : true;
1218212182
ClpSimplex *small = static_cast< ClpSimplexOther * >(this)->crunch(rhs, whichRow, whichColumn,
1218312183
nBound, false, tightenBounds);

src/ClpSimplexOther.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1775,7 +1775,7 @@ ClpSimplex *
17751775
ClpSimplexOther::crunch(double *rhs, int *whichRow, int *whichColumn,
17761776
int &nBound, bool moreBounds, bool tightenBounds)
17771777
{
1778-
#if 0
1778+
#if 1
17791779
/* If you only want to find redundant rows before fathom then
17801780
use this and set numberRows_ negative before this call (in ClpSimplex.cpp)
17811781
*/
@@ -1786,7 +1786,7 @@ ClpSimplexOther::crunch(double *rhs, int *whichRow, int *whichColumn,
17861786
}
17871787
#else
17881788
assert (numberRows_>=0);
1789-
bool takeOutSome=false;//true;
1789+
bool takeOutSome=true;
17901790
#endif
17911791
//#define CHECK_STATUS
17921792
#ifdef CHECK_STATUS

src/OsiClp/OsiClpSolverInterface.cpp

+8-2
Original file line numberDiff line numberDiff line change
@@ -7940,8 +7940,11 @@ void OsiClpSolverInterface::crunch()
79407940
nBound, moreBounds, tightenBounds);
79417941
#ifndef NDEBUG
79427942
int nCopy = 3 * numberRows + 2 * numberColumns;
7943-
for (int i = 0; i < nCopy; i++)
7943+
for (int i = 0; i < nCopy; i++) {
7944+
if (i>=small->getNumRows()&&i<numberRows)
7945+
continue; // row was removed so doesn't matter
79447946
assert(whichRow[i] >= -CoinMax(numberRows, numberColumns) && whichRow[i] < CoinMax(numberRows, numberColumns));
7947+
}
79457948
#endif
79467949
smallModel_ = small;
79477950
spareArrays_ = spareArrays;
@@ -7953,8 +7956,11 @@ void OsiClpSolverInterface::crunch()
79537956
int nCopy = 3 * numberRows + 2 * numberColumns;
79547957
nBound = whichRow[nCopy];
79557958
#ifndef NDEBUG
7956-
for (int i = 0; i < nCopy; i++)
7959+
for (int i = 0; i < nCopy; i++) {
7960+
if (i>=smallModel_->getNumRows()&&i<numberRows)
7961+
continue; // row was removed so doesn't matter
79577962
assert(whichRow[i] >= -CoinMax(numberRows, numberColumns) && whichRow[i] < CoinMax(numberRows, numberColumns));
7963+
}
79587964
#endif
79597965
small = smallModel_;
79607966
}

0 commit comments

Comments
 (0)