source: ThirdParty/Glpk/trunk/glpk.patch @ 788

Last change on this file since 788 was 788, checked in by stefan, 14 years ago

update to glpk 4.24
add patch to get correct status code if terminated because the gap is closed

File size: 1.9 KB
RevLine 
[788]1diff -Naur glpk/include/glpk.h glpk.patched/include/glpk.h
2--- glpk/include/glpk.h 2007-11-21 10:00:00.000000000 +0100
3+++ glpk.patched/include/glpk.h 2007-11-24 15:13:27.000000000 +0100
4@@ -30,7 +30,7 @@
5 
6 /* library version numbers: */
7 #define GLP_MAJOR_VERSION  4
8-#define GLP_MINOR_VERSION  23
9+#define GLP_MINOR_VERSION  24
10 
11 #ifndef _GLP_PROB
12 #define _GLP_PROB
13diff -Naur glpk.OLD/src/glpapi08.c glpk.patched/src/glpapi08.c
14--- glpk/src/glpapi08.c 2007-11-21 10:00:00.000000000 +0100
15+++ glpk.patched/src/glpapi08.c 2007-11-24 15:13:03.000000000 +0100
16@@ -345,9 +345,15 @@
17       switch (ret)
18       {  case 0:
19             if (tree->mip->mip_stat == GLP_FEAS)
20-            {  if (parm->msg_lev >= GLP_MSG_ALL)
21-                  xprintf("INTEGER OPTIMAL SOLUTION FOUND\n");
22-               tree->mip->mip_stat = GLP_OPT;
23+             { if (ios_relative_gap(tree) > 0) {
24+                               if (parm->msg_lev >= GLP_MSG_ALL)
25+                                       xprintf("INTEGER FEASIBLE SOLUTION FOUND, GAP SMALLER THAN TOLERANCE\n");
26+                               tree->mip->mip_stat = GLP_FEAS;
27+               } else {
28+                       if (parm->msg_lev >= GLP_MSG_ALL)
29+                               xprintf("INTEGER OPTIMAL SOLUTION FOUND\n");
30+                       tree->mip->mip_stat = GLP_OPT;
31+               }
32             }
33             else
34             {  if (parm->msg_lev >= GLP_MSG_ALL)
35diff -Naur glpk.OLD/src/glpios03.c glpk.patched/src/glpios03.c
36--- glpk/src/glpios03.c 2007-11-21 10:00:00.000000000 +0100
37+++ glpk.patched/src/glpios03.c 2007-11-24 15:13:09.000000000 +0100
38@@ -1341,7 +1341,7 @@
39          {  if (tree->parm->msg_lev >= GLP_MSG_DBG)
40                xprintf("Relative gap tolerance reached; search terminat"
41                   "ed\n");
42-            ret = GLP_ETMLIM;
43+            ret = 0;
44             goto done;
45          }
46 #endif
Note: See TracBrowser for help on using the repository browser.