Skip to content

Commit

Permalink
allow better duals on max iterations
Browse files Browse the repository at this point in the history
  • Loading branch information
jjhforrest committed Mar 29, 2024
1 parent e39a7ec commit cdead12
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/ClpModel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1195,6 +1195,7 @@ class CLPLIB_EXPORT ClpModel {
0x01000000 is Cbc (and in branch and bound)
0x02000000 is in a different branch and bound
0x04000000 - zero costs!
0x08000000 - get correct duals on max iterations
*/
inline unsigned int specialOptions() const
{
Expand Down
2 changes: 2 additions & 0 deletions src/ClpSimplexDual.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1847,6 +1847,8 @@ int ClpSimplexDual::whileIterating(double *&givenDuals, int ifValuesPass)
} else if (whatNext == 2) {
// maximum iterations or equivalent
problemStatus_ = 3;
if ((specialOptions_&0x08000000)!=0)
gutsOfSolution(NULL,NULL); // clean up
returnCode = 3;
break;
}
Expand Down
8 changes: 4 additions & 4 deletions src/OsiClp/OsiClpSolverInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1638,16 +1638,16 @@ void OsiClpSolverInterface::setupForRepeatedUse(int senseOfAdventure, int printO
// First try
switch (senseOfAdventure) {
case 0:
specialOptions_ = 8;
specialOptions_ |= 8;
break;
case 1:
specialOptions_ = 1 + 2 + 8;
specialOptions_ |= 1 + 2 + 8;
break;
case 2:
specialOptions_ = 1 + 2 + 4 + 8;
specialOptions_ |= 1 + 2 + 4 + 8;
break;
case 3:
specialOptions_ = 1 + 8;
specialOptions_ |= 1 + 8;
break;
}
//#define NO_CRUNCH2
Expand Down

0 comments on commit cdead12

Please sign in to comment.