<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Hello,<div><br></div><div>I am testing my global cut generator for outer approximation of piece-wise linear convex function. My implementation uses <i>OsiBabSolver::solverType_ = 3</i> and manually sets up <i>mipBound_&nbsp;</i>and <i>bestObjectiveValue_</i>, while generating global cuts.</div><div><br></div><div>Here is my issue. After running many iterations, Cbc complains the following:</div><div><i>&nbsp;&nbsp;Assertion failed: (clpMatrix-&gt;getNumRows()==modelPtr_-&gt;getNumRows()), function freeCachedResults, file ../../../../Clp/src/OsiClp/OsiClpSolverInterface.cpp, line 4491.</i></div><div>and backtrace reports</div><div><div><i>&nbsp; * frame #0: 0x00007fff9a5c8866 libsystem_kernel.dylib`__pthread_kill + 10</i></div><div><i>&nbsp; &nbsp; frame #1: 0x00007fff9948035c libsystem_pthread.dylib`pthread_kill + 92</i></div><div><i>&nbsp; &nbsp; frame #2: 0x00007fff947fbb1a libsystem_c.dylib`abort + 125</i></div><div><i>&nbsp; &nbsp; frame #3: 0x00007fff947c59bf libsystem_c.dylib`__assert_rtn + 321</i></div><div><i>&nbsp; &nbsp; frame #4: 0x00000001003e3187 MyTest`OsiClpSolverInterface::freeCachedResults(this=0x000000010afb1320) const + 623 at OsiClpSolverInterface.cpp:4491</i></div><div><i>&nbsp; &nbsp; frame #5: 0x00000001003dcd27 MyTest`OsiClpSolverInterface::deleteRows(this=0x000000010afb1320, num=1, rowIndices=0x000000010afc8380) + 729 at OsiClpSolverInterface.cpp:3491</i></div><div><i>&nbsp; &nbsp; frame #6: 0x00000001000b50af MyTest`CbcModel::takeOffCuts(this=0x000000010172d000, newCuts=0x00007fff5fbfd120, allowResolve=true, saveCuts=0x0000000000000000, numberNewCuts=0, addedCuts=0x0000000000000000) + 2029 at CbcModel.cpp:9792</i></div><div><i>&nbsp; &nbsp; frame #7: 0x00000001000b080f MyTest`CbcModel::solveWithCuts(this=0x000000010172d000, cuts=0x00007fff5fbfd120, numberTries=0, node=0x000000010b31a6c0) + 16359 at CbcModel.cpp:8563</i></div><div><i>&nbsp; &nbsp; frame #8: 0x00000001000c9765 MyTest`CbcModel::doOneNode(this=0x000000010172d000, baseModel=0x000000010172d000, node=0x00007fff5fbfd880, newNode=0x00007fff5fbfd938) + 2745 at CbcModel.cpp:14944</i></div><div><i>&nbsp; &nbsp; frame #9: 0x000000010009b8d8 MyTest`CbcModel::branchAndBound(this=0x000000010172d000, doStatistics=0) + 49158 at CbcModel.cpp:4500</i></div></div><div><br></div><div>The issue is because <i>OsiClpSolverInterface::deleteRows()</i> tries deleting rows that are out of range. This results in that the row counter of <i>clpMatrix</i> is reduced whereas the model row counter is not. The reason that <i>solverCutIndices</i> in <i>CbcModel::takeOffCuts()</i> contained out-of-range indices is that <i>CbcMode::globalCuts_</i> were counted in <i>solverCutIndices</i> (in <i>CbcModel::takeOffCuts</i>), but the global cuts were not applied to solver_ yet.</div><div><br></div><div>Then, my question is</div><div>1. Should I have added the global cuts manually to <i>solver_</i> before getting into <i>takeOffCuts()</i>?</div><div>2. or should this be handled in <i>OsiClpSolverInterface</i> side?</div><div><br></div><div>Thanks all for your helps in advance,</div><div><br></div><div>Best,</div><div><br></div><div>Kibaek</div></body></html>