Commit 499b8ac
cbc: fix isfile import and Cbc_reset before re-solve
Two fixes for newer CBC (cbcbox 2.901):
1. Add missing 'isfile' import from os.path in cbc.py (used in
SolverCbc.read() but was not imported, causing NameError in
mip_files_test).
2. Call Cbc_reset() before Cbc_solve() to clear stale solution state
when re-solving the same model. Newer CBC's Cbc_solve() returns
the old objective value without a reset. Cbc_reset() also resets
the objective sense to MINIMIZE, so save and restore it around
the call.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 62a0ee6 commit 499b8ac
1 file changed
+7
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
1222 | 1222 | | |
1223 | 1223 | | |
1224 | 1224 | | |
| 1225 | + | |
| 1226 | + | |
| 1227 | + | |
| 1228 | + | |
| 1229 | + | |
| 1230 | + | |
1225 | 1231 | | |
1226 | 1232 | | |
1227 | 1233 | | |
| |||
0 commit comments