diff --git a/LINKERN/linkern.c b/LINKERN/linkern.c index ae17dde..24c39e3 100755 --- a/LINKERN/linkern.c +++ b/LINKERN/linkern.c @@ -1176,7 +1176,7 @@ static int weird_second_step (graph *G, distobj *D, adddel *E, aqueue *Q, markedge_del (t7, t8, E); hit = step (G, D, E, Q, F, 3, gain, &Gstar, t1, t8, fstack, intptr_world, edgelook_world); - unmarkedge_del (t6, t7, E); + unmarkedge_add (t6, t7, E); unmarkedge_del (t7, t8, E); if (!hit && Gstar) diff --git a/LINKERN/linkern_fixed.c b/LINKERN/linkern_fixed.c index 2e52746..210a760 100755 --- a/LINKERN/linkern_fixed.c +++ b/LINKERN/linkern_fixed.c @@ -837,7 +837,7 @@ static int weird_second_step (graph *G, distobj *D, adddel *E, aqueue *Q, markedge_del (t7, t8, E); hit = step (G, D, E, Q, F, 3, gain, &Gstar, t1, t8, fstack, intptr_world, edgelook_world); - unmarkedge_del (t6, t7, E); + unmarkedge_add (t6, t7, E); unmarkedge_del (t7, t8, E); if (!hit && Gstar) diff --git a/LINKERN/linkern_path.c b/LINKERN/linkern_path.c index bda03f9..64a3988 100755 --- a/LINKERN/linkern_path.c +++ b/LINKERN/linkern_path.c @@ -842,7 +842,7 @@ static int weird_second_step (graph *G, distobj *D, adddel *E, aqueue *Q, markedge_del (t7, t8, E); hit = step (G, D, E, Q, F, 3, gain, &Gstar, t1, t8, fstack, intptr_world, edgelook_world); - unmarkedge_del (t6, t7, E); + unmarkedge_add (t6, t7, E); unmarkedge_del (t7, t8, E); if (!hit && Gstar) diff --git a/LP/lpcplex4.c b/LP/lpcplex4.c index adb5020..99e83e5 100755 --- a/LP/lpcplex4.c +++ b/LP/lpcplex4.c @@ -155,7 +155,7 @@ int CClp_init (CClp **lp) goto CLEANUP; } - /* REB, 14 October 1997: The following three parameter settings + /* REB, 14 October 1997: The following three parameter settings help fl3795 a bunch, and are probably not a bad idea in general */ rval = CPXsetdblparam ((*lp)->cplex_env, CPX_PARAM_EPPER, 1.0E-6); @@ -405,12 +405,12 @@ static int primalopt (CClp *lp) int solstat; #ifdef CC_CPLEX_WRITE_PRIMAL static int probcnt = 0; - char probname[100]; + char probname[512]; sprintf (probname, "prim%d.sav", probcnt); probcnt++; printf ("Writing %s\n", probname); - CPXsavwrite (lp->cplex_env, lp->cplex_lp, probname); + CPXwriteprob (lp->cplex_env, lp->cplex_lp, probname, NULL); #endif rval = CPXoptimize (lp->cplex_env, lp->cplex_lp); @@ -469,12 +469,12 @@ static int dualopt (CClp *lp) int solstat; #ifdef CC_CPLEX_WRITE_DUAL static int probcnt = 0; - char probname[100]; + char probname[512]; sprintf (probname, "dual%d.sav", probcnt); probcnt++; printf ("Writing %s\n", probname); - CPXsavwrite (lp->cplex_env, lp->cplex_lp, probname); + CPXwriteprob (lp->cplex_env, lp->cplex_lp, probname, NULL); #endif rval = CPXdualopt (lp->cplex_env, lp->cplex_lp); @@ -541,12 +541,12 @@ static int baropt (CClp *lp) int solstat; #ifdef CC_CPLEX_WRITE_BARRIER static int probcnt = 0; - char probname[100]; + char probname[512]; sprintf (probname, "barrier%d.sav", probcnt); probcnt++; printf ("Writing %s\n", probname); - CPXsavwrite (lp->cplex_env, lp->cplex_lp, probname); + CPXwriteprob (lp->cplex_env, lp->cplex_lp, probname, NULL); #endif rval = CPXbaropt (lp->cplex_env, lp->cplex_lp); @@ -891,7 +891,7 @@ int CClp_delete_set_of_rows (CClp *lp, int *delstat) fprintf (stderr, "CPXpivotin failed, continuing anyway\n"); } CC_FREE (dellist, int); - + rval = CPXdelsetrows (lp->cplex_env, lp->cplex_lp, delstat); if (rval) fprintf (stderr, "CPXdelsetrows failed\n"); return rval; @@ -1472,15 +1472,10 @@ int CClp_getweight (CClp *lp, int nrows, int *rmatbeg, int *rmatind, int CClp_dump_lp (CClp *lp, const char *fname) { int rval = 0; - char nambuf[32]; - - /* We copy the name since CPXsavwrite doesn't declare fname as const */ - strncpy (nambuf, fname, sizeof (nambuf)); - nambuf[sizeof(nambuf)-1] = '\0'; - rval = CPXsavwrite (lp->cplex_env, lp->cplex_lp, nambuf); + rval = CPXwriteprob (lp->cplex_env, lp->cplex_lp, fname, NULL); if (rval) { - fprintf (stderr, "CPXsavwrite failed\n"); + fprintf (stderr, "CPXwriteprob failed\n"); } return rval; } diff --git a/LP/lpcplex5.c b/LP/lpcplex5.c index 4688fb0..484185e 100755 --- a/LP/lpcplex5.c +++ b/LP/lpcplex5.c @@ -198,7 +198,7 @@ int CClp_init (CClp **lp) goto CLEANUP; } - /* REB, 14 October 1997: The following three parameter settings + /* REB, 14 October 1997: The following three parameter settings help fl3795 a bunch, and are probably not a bad idea in general */ rval = CPXsetdblparam ((*lp)->cplex_env, CPX_PARAM_EPPER, 1.0E-6); @@ -428,12 +428,12 @@ static int primalopt (CClp *lp) int solstat; #ifdef CC_CPLEX_WRITE_PRIMAL static int probcnt = 0; - char probname[100]; + char probname[512]; sprintf (probname, "prim%d.sav", probcnt); probcnt++; printf ("Writing %s\n", probname); - CPXsavwrite (lp->cplex_env, lp->cplex_lp, probname); + CPXwriteprob (lp->cplex_env, lp->cplex_lp, probname, NULL); #endif rval = CPXprimopt (lp->cplex_env, lp->cplex_lp); @@ -492,12 +492,12 @@ static int dualopt (CClp *lp) int solstat; #ifdef CC_CPLEX_WRITE_DUAL static int probcnt = 0; - char probname[100]; + char probname[512]; sprintf (probname, "dual%d.sav", probcnt); probcnt++; printf ("Writing %s\n", probname); - CPXsavwrite (lp->cplex_env, lp->cplex_lp, probname); + CPXwriteprob (lp->cplex_env, lp->cplex_lp, probname, NULL); #endif rval = CPXdualopt (lp->cplex_env, lp->cplex_lp); @@ -564,12 +564,12 @@ static int baropt (CClp *lp) int solstat; #ifdef CC_CPLEX_WRITE_BARRIER static int probcnt = 0; - char probname[100]; + char probname[512]; sprintf (probname, "barrier%d.sav", probcnt); probcnt++; printf ("Writing %s\n", probname); - CPXsavwrite (lp->cplex_env, lp->cplex_lp, probname); + CPXwriteprob (lp->cplex_env, lp->cplex_lp, probname, NULL); #endif rval = CPXbaropt (lp->cplex_env, lp->cplex_lp); @@ -893,7 +893,7 @@ int CClp_delete_set_of_rows (CClp *lp, int *delstat) fprintf (stderr, "CPXpivotin failed, continuing anyway\n"); } CC_FREE (dellist, int); - + rval = CPXdelsetrows (lp->cplex_env, lp->cplex_lp, delstat); if (rval) fprintf (stderr, "CPXdelsetrows failed\n"); return rval; @@ -987,7 +987,7 @@ int CClp_delete_set_of_columns (CClp *lp, int *delstat) if (CPXchgbds (lp->cplex_env, lp->cplex_lp, delcnt, dellist, lu, bd)) { fprintf (stderr, "CPXchgbds failed, stumbling on anyway\n"); } - + if (CPXdualopt (lp->cplex_env, lp->cplex_lp)) { fprintf (stderr, "CPXdualopt failed, continuing anyway\n"); } @@ -999,7 +999,7 @@ int CClp_delete_set_of_columns (CClp *lp, int *delstat) CC_FREE (dellist, int); CC_FREE (lu, char); CC_FREE (bd, double); - + rval = CPXdelsetcols (lp->cplex_env, lp->cplex_lp, delstat); if (rval) fprintf (stderr, "CPXdelsetcols failed\n"); return rval; @@ -1233,7 +1233,7 @@ int CClp_sread_warmstart (CC_SFILE *f, CClp_warmstart **w) (*w)->ccount = ccount; (*w)->rcount = rcount; - + return 0; CLEANUP: @@ -1558,15 +1558,10 @@ int CClp_getweight (CClp *lp, int nrows, int *rmatbeg, int *rmatind, int CClp_dump_lp (CClp *lp, const char *fname) { int rval = 0; - char nambuf[32]; - - /* We copy the name since CPXsavwrite doesn't declare fname as const */ - strncpy (nambuf, fname, sizeof (nambuf)); - nambuf[sizeof(nambuf)-1] = '\0'; - rval = CPXsavwrite (lp->cplex_env, lp->cplex_lp, nambuf); + rval = CPXwriteprob (lp->cplex_env, lp->cplex_lp, fname, NULL); if (rval) { - fprintf (stderr, "CPXsavwrite failed\n"); + fprintf (stderr, "CPXwriteprob failed\n"); } return rval; } @@ -1672,7 +1667,7 @@ int CClp_getgoodlist (CClp *lp, int *goodlist, int *goodlen_p, } rval = 0; - + CLEANUP: CC_IFFREE (cstat, int); @@ -1745,12 +1740,12 @@ int CClp_strongbranch (CClp *lp, int *candidatelist, int ncand, if (rval) { fprintf (stderr, "CPXsetdblparam failed\n"); return rval; } - + for (i=0; i upperbound) downpen[i] = upperbound; if (uppen[i] > upperbound) uppen[i] = upperbound; } - + return 0; } @@ -1881,7 +1876,7 @@ static int getfarkasmultipliers (CClp *lp, double *y) static int set_parameters (CPXENVptr cplex_env, CClp_parameters *params) { int rval; - + /* the documentation doesn't say what the return value means */ rval = CPXsetintparam (cplex_env, CPX_PARAM_SCRIND, params->scrind); if (rval) { @@ -1932,7 +1927,7 @@ static int set_parameters (CPXENVptr cplex_env, CClp_parameters *params) fprintf (stderr, "CPXsetdblparam CPX_PARAM_EPRHS failed\n"); goto CLEANUP; } - + rval = CPXsetintparam (cplex_env, CPX_PARAM_PERIND, params->perind); if (rval) { fprintf (stderr, "CPXsetintparam CPX_PARAM_PERIND failed\n"); diff --git a/LP/lpcplex6.c b/LP/lpcplex6.c index f279af5..c12ffba 100755 --- a/LP/lpcplex6.c +++ b/LP/lpcplex6.c @@ -198,7 +198,7 @@ int CClp_init (CClp **lp) goto CLEANUP; } - /* REB, 14 October 1997: The following three parameter settings + /* REB, 14 October 1997: The following three parameter settings help fl3795 a bunch, and are probably not a bad idea in general */ rval = CPXsetdblparam ((*lp)->cplex_env, CPX_PARAM_EPPER, 1.0E-6); @@ -426,7 +426,7 @@ static int primalopt (CClp *lp) { int rval; int solstat; - + /* double szeit = CCutil_zeit (); static double trickit = 0.0; @@ -439,12 +439,12 @@ static int primalopt (CClp *lp) #ifdef CC_CPLEX_WRITE_PRIMAL static int probcnt = 0; - char probname[100]; + char probname[512]; sprintf (probname, "prim%d.sav", probcnt); probcnt++; printf ("Writing %s\n", probname); - CPXsavwrite (lp->cplex_env, lp->cplex_lp, probname); + CPXwriteprob (lp->cplex_env, lp->cplex_lp, probname, NULL); #endif rval = CPXprimopt (lp->cplex_env, lp->cplex_lp); @@ -523,12 +523,12 @@ static int dualopt (CClp *lp) int solstat; #ifdef CC_CPLEX_WRITE_DUAL static int probcnt = 0; - char probname[100]; + char probname[512]; sprintf (probname, "dual%d.sav", probcnt); probcnt++; printf ("Writing %s\n", probname); - CPXsavwrite (lp->cplex_env, lp->cplex_lp, probname); + CPXwriteprob (lp->cplex_env, lp->cplex_lp, probname, NULL); #endif rval = CPXdualopt (lp->cplex_env, lp->cplex_lp); @@ -595,12 +595,12 @@ static int baropt (CClp *lp) int solstat; #ifdef CC_CPLEX_WRITE_BARRIER static int probcnt = 0; - char probname[100]; + char probname[512]; sprintf (probname, "barrier%d.sav", probcnt); probcnt++; printf ("Writing %s\n", probname); - CPXsavwrite (lp->cplex_env, lp->cplex_lp, probname); + CPXwriteprob (lp->cplex_env, lp->cplex_lp, probname, NULL); #endif rval = CPXbaropt (lp->cplex_env, lp->cplex_lp); @@ -924,7 +924,7 @@ int CClp_delete_set_of_rows (CClp *lp, int *delstat) fprintf (stderr, "CPXpivotin failed, continuing anyway\n"); } CC_FREE (dellist, int); - + rval = CPXdelsetrows (lp->cplex_env, lp->cplex_lp, delstat); if (rval) fprintf (stderr, "CPXdelsetrows failed\n"); return rval; @@ -1018,7 +1018,7 @@ int CClp_delete_set_of_columns (CClp *lp, int *delstat) if (CPXchgbds (lp->cplex_env, lp->cplex_lp, delcnt, dellist, lu, bd)) { fprintf (stderr, "CPXchgbds failed, stumbling on anyway\n"); } - + if (CPXdualopt (lp->cplex_env, lp->cplex_lp)) { fprintf (stderr, "CPXdualopt failed, continuing anyway\n"); } @@ -1030,7 +1030,7 @@ int CClp_delete_set_of_columns (CClp *lp, int *delstat) CC_FREE (dellist, int); CC_FREE (lu, char); CC_FREE (bd, double); - + rval = CPXdelsetcols (lp->cplex_env, lp->cplex_lp, delstat); if (rval) fprintf (stderr, "CPXdelsetcols failed\n"); return rval; @@ -1264,7 +1264,7 @@ int CClp_sread_warmstart (CC_SFILE *f, CClp_warmstart **w) (*w)->ccount = ccount; (*w)->rcount = rcount; - + return 0; CLEANUP: @@ -1589,15 +1589,10 @@ int CClp_getweight (CClp *lp, int nrows, int *rmatbeg, int *rmatind, int CClp_dump_lp (CClp *lp, const char *fname) { int rval = 0; - char nambuf[32]; - /* We copy the name since CPXsavwrite doesn't declare fname as const */ - strncpy (nambuf, fname, sizeof (nambuf)); - nambuf[sizeof(nambuf)-1] = '\0'; - - rval = CPXsavwrite (lp->cplex_env, lp->cplex_lp, nambuf); + rval = CPXwriteprob (lp->cplex_env, lp->cplex_lp, fname, NULL); if (rval) { - fprintf (stderr, "CPXsavwrite failed\n"); + fprintf (stderr, "CPXwriteprob failed\n"); } return rval; } @@ -1703,7 +1698,7 @@ int CClp_getgoodlist (CClp *lp, int *goodlist, int *goodlen_p, } rval = 0; - + CLEANUP: CC_IFFREE (cstat, int); @@ -1776,12 +1771,12 @@ int CClp_strongbranch (CClp *lp, int *candidatelist, int ncand, if (rval) { fprintf (stderr, "CPXsetdblparam failed\n"); return rval; } - + for (i=0; i upperbound) downpen[i] = upperbound; if (uppen[i] > upperbound) uppen[i] = upperbound; } - + return 0; } @@ -1912,7 +1907,7 @@ static int getfarkasmultipliers (CClp *lp, double *y) static int set_parameters (CPXENVptr cplex_env, CClp_parameters *params) { int rval; - + /* the documentation doesn't say what the return value means */ rval = CPXsetintparam (cplex_env, CPX_PARAM_SCRIND, params->scrind); if (rval) { @@ -1963,7 +1958,7 @@ static int set_parameters (CPXENVptr cplex_env, CClp_parameters *params) fprintf (stderr, "CPXsetdblparam CPX_PARAM_EPRHS failed\n"); goto CLEANUP; } - + rval = CPXsetintparam (cplex_env, CPX_PARAM_PERIND, params->perind); if (rval) { fprintf (stderr, "CPXsetintparam CPX_PARAM_PERIND failed\n"); diff --git a/LP/lpcplex8.c b/LP/lpcplex8.c index fdfd24b..d789efd 100755 --- a/LP/lpcplex8.c +++ b/LP/lpcplex8.c @@ -43,6 +43,10 @@ #undef CC_CPLEX_DISPLAY +#ifndef CPX_PARAM_FASTMIP +#define CPX_PARAM_FASTMIP 1017 +#endif + #define CC_ONE_ENV #ifdef CC_ONE_ENV @@ -198,7 +202,7 @@ int CClp_init (CClp **lp) goto CLEANUP; } - /* REB, 14 October 1997: The following three parameter settings + /* REB, 14 October 1997: The following three parameter settings help fl3795 a bunch, and are probably not a bad idea in general */ rval = CPXsetdblparam ((*lp)->cplex_env, CPX_PARAM_EPPER, 1.0E-6); @@ -429,12 +433,12 @@ static int primalopt (CClp *lp) int solstat; #ifdef CC_CPLEX_WRITE_PRIMAL static int probcnt = 0; - char probname[100]; + char probname[512]; sprintf (probname, "prim%d.sav", probcnt); probcnt++; printf ("Writing %s\n", probname); - CPXsavwrite (lp->cplex_env, lp->cplex_lp, probname); + CPXwriteprob (lp->cplex_env, lp->cplex_lp, probname, NULL); #endif rval = CPXprimopt (lp->cplex_env, lp->cplex_lp); @@ -494,12 +498,12 @@ static int dualopt (CClp *lp) int solstat; #ifdef CC_CPLEX_WRITE_DUAL static int probcnt = 0; - char probname[100]; + char probname[512]; sprintf (probname, "dual%d.sav", probcnt); probcnt++; printf ("Writing %s\n", probname); - CPXsavwrite (lp->cplex_env, lp->cplex_lp, probname); + CPXwriteprob (lp->cplex_env, lp->cplex_lp, probname, NULL); #endif rval = CPXdualopt (lp->cplex_env, lp->cplex_lp); @@ -567,12 +571,12 @@ static int baropt (CClp *lp) int solstat; #ifdef CC_CPLEX_WRITE_BARRIER static int probcnt = 0; - char probname[100]; + char probname[512]; sprintf (probname, "barrier%d.sav", probcnt); probcnt++; printf ("Writing %s\n", probname); - CPXsavwrite (lp->cplex_env, lp->cplex_lp, probname); + CPXwriteprob (lp->cplex_env, lp->cplex_lp, probname, NULL); #endif rval = CPXbaropt (lp->cplex_env, lp->cplex_lp); @@ -915,7 +919,7 @@ int CClp_delete_set_of_rows (CClp *lp, int *delstat) fprintf (stderr, "CPXpivotin failed, continuing anyway\n"); } CC_FREE (dellist, int); - + rval = CPXdelsetrows (lp->cplex_env, lp->cplex_lp, delstat); if (rval) fprintf (stderr, "CPXdelsetrows failed\n"); return rval; @@ -1009,7 +1013,7 @@ int CClp_delete_set_of_columns (CClp *lp, int *delstat) if (CPXchgbds (lp->cplex_env, lp->cplex_lp, delcnt, dellist, lu, bd)) { fprintf (stderr, "CPXchgbds failed, stumbling on anyway\n"); } - + if (CPXdualopt (lp->cplex_env, lp->cplex_lp)) { fprintf (stderr, "CPXdualopt failed, continuing anyway\n"); } @@ -1021,7 +1025,7 @@ int CClp_delete_set_of_columns (CClp *lp, int *delstat) CC_FREE (dellist, int); CC_FREE (lu, char); CC_FREE (bd, double); - + rval = CPXdelsetcols (lp->cplex_env, lp->cplex_lp, delstat); if (rval) fprintf (stderr, "CPXdelsetcols failed\n"); return rval; @@ -1255,7 +1259,7 @@ int CClp_sread_warmstart (CC_SFILE *f, CClp_warmstart **w) (*w)->ccount = ccount; (*w)->rcount = rcount; - + return 0; CLEANUP: @@ -1580,15 +1584,10 @@ int CClp_getweight (CClp *lp, int nrows, int *rmatbeg, int *rmatind, int CClp_dump_lp (CClp *lp, const char *fname) { int rval = 0; - char nambuf[32]; - /* We copy the name since CPXsavwrite doesn't declare fname as const */ - strncpy (nambuf, fname, sizeof (nambuf)); - nambuf[sizeof(nambuf)-1] = '\0'; - - rval = CPXsavwrite (lp->cplex_env, lp->cplex_lp, nambuf); + rval = CPXwriteprob (lp->cplex_env, lp->cplex_lp, fname, NULL); if (rval) { - fprintf (stderr, "CPXsavwrite failed\n"); + fprintf (stderr, "CPXwriteprob failed\n"); } return rval; } @@ -1694,7 +1693,7 @@ int CClp_getgoodlist (CClp *lp, int *goodlist, int *goodlen_p, } rval = 0; - + CLEANUP: CC_IFFREE (cstat, int); @@ -1767,12 +1766,12 @@ int CClp_strongbranch (CClp *lp, int *candidatelist, int ncand, if (rval) { fprintf (stderr, "CPXsetdblparam failed\n"); return rval; } - + for (i=0; i upperbound) downpen[i] = upperbound; if (uppen[i] > upperbound) uppen[i] = upperbound; } - + return 0; } @@ -1903,7 +1902,7 @@ static int getfarkasmultipliers (CClp *lp, double *y) static int set_parameters (CPXENVptr cplex_env, CClp_parameters *params) { int rval; - + /* the documentation doesn't say what the return value means */ rval = CPXsetintparam (cplex_env, CPX_PARAM_SCRIND, params->scrind); if (rval) { @@ -1954,7 +1953,7 @@ static int set_parameters (CPXENVptr cplex_env, CClp_parameters *params) fprintf (stderr, "CPXsetdblparam CPX_PARAM_EPRHS failed\n"); goto CLEANUP; } - + rval = CPXsetintparam (cplex_env, CPX_PARAM_PERIND, params->perind); if (rval) { fprintf (stderr, "CPXsetintparam CPX_PARAM_PERIND failed\n"); diff --git a/Makefile.in b/Makefile.in index 036a62b..5fca295 100755 --- a/Makefile.in +++ b/Makefile.in @@ -24,7 +24,7 @@ VPATH = @srcdir@ CC = @CC@ CFLAGS = @CFLAGS@ @CPPFLAGS@ -I$(BLDROOT)/INCLUDE -I$(CCINCDIR) LDFLAGS = @CFLAGS@ @LDFLAGS@ -LIBFLAGS = @LIBS@ -lpthread +LIBFLAGS = @LIBS@ -lpthread -dl RANLIB = @RANLIB@ OBJ_SUFFIX = @OBJ_SUFFIX@ diff --git a/TSP/Makefile.in b/TSP/Makefile.in index a2f89b2..3e386f6 100755 --- a/TSP/Makefile.in +++ b/TSP/Makefile.in @@ -23,7 +23,7 @@ VPATH = @srcdir@ CC = @CC@ CFLAGS = @CFLAGS@ @CPPFLAGS@ -I$(BLDROOT)/INCLUDE -I$(CCINCDIR) LDFLAGS = @CFLAGS@ @LDFLAGS@ -LIBFLAGS = @LIBS@ -lpthread +LIBFLAGS = @LIBS@ -lpthread -ldl RANLIB = @RANLIB@ LPSOLVER_LIB = @LPSOLVER_LIB@