Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion LINKERN/linkern.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion LINKERN/linkern_fixed.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion LINKERN/linkern_path.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
25 changes: 10 additions & 15 deletions LP/lpcplex4.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand Down
41 changes: 18 additions & 23 deletions LP/lpcplex5.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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");
}
Expand All @@ -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;
Expand Down Expand Up @@ -1233,7 +1233,7 @@ int CClp_sread_warmstart (CC_SFILE *f, CClp_warmstart **w)

(*w)->ccount = ccount;
(*w)->rcount = rcount;

return 0;

CLEANUP:
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -1672,7 +1667,7 @@ int CClp_getgoodlist (CClp *lp, int *goodlist, int *goodlen_p,
}

rval = 0;

CLEANUP:

CC_IFFREE (cstat, int);
Expand Down Expand Up @@ -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<ncand; i++) {
if (downpen[i] > upperbound) downpen[i] = upperbound;
if (uppen[i] > upperbound) uppen[i] = upperbound;
}

return 0;
}

Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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");
Expand Down
Loading