Patch flute to be compatible with boost 1.65.

* Bug: In flute, a 'D' macro is defined which collides with another one
    from Boost 1.65. Rename it into 'DPARAM'.
This commit is contained in:
Jean-Paul Chaput 2019-03-04 12:34:43 +01:00
parent 0f4c8ec181
commit 915eaf2157
3 changed files with 18 additions and 18 deletions

View File

@ -10,13 +10,13 @@ using std::max;
namespace Flute {
#if D<=7
#if DPARAM<=7
#define MGROUP 5040/4 // Max. # of groups, 7! = 5040
#define MPOWV 15 // Max. # of POWVs per group
#elif D==8
#elif DPARAM==8
#define MGROUP 40320/4 // Max. # of groups, 8! = 40320
#define MPOWV 33 // Max. # of POWVs per group
#elif D==9
#elif DPARAM==9
#define MGROUP 362880/4 // Max. # of groups, 9! = 362880
#define MPOWV 79 // Max. # of POWVs per group
#endif
@ -26,11 +26,11 @@ struct csoln
{
unsigned char parent;
unsigned char seg[11]; // Add: 0..i, Sub: j..10; seg[i+1]=seg[j-1]=0
unsigned char rowcol[D-2]; // row = rowcol[]/16, col = rowcol[]%16,
unsigned char neighbor[2*D-2];
unsigned char rowcol[DPARAM-2]; // row = rowcol[]/16, col = rowcol[]%16,
unsigned char neighbor[2*DPARAM-2];
};
struct csoln *LUT[D+1][MGROUP]; // storing 4 .. D
int numsoln[D+1][MGROUP];
struct csoln *LUT[DPARAM+1][MGROUP]; // storing 4 .. D
int numsoln[DPARAM+1][MGROUP];
struct point
{
@ -96,7 +96,7 @@ void readLUT( string directory )
}
#endif
for (d=4; d<=D; d++) {
for (d=4; d<=DPARAM; d++) {
fscanf(fpwv, "d=%d\n", &d);
#if ROUTING==1
fscanf(fprt, "d=%d\n", &d);
@ -272,7 +272,7 @@ DTYPE flutes_wl_LD(int d, DTYPE xs[], DTYPE ys[], int s[])
{
int k, pi, i, j;
struct csoln *rlist;
DTYPE dd[2*D-2]; // 0..D-2 for v, D-1..2*D-3 for h
DTYPE dd[2*DPARAM-2]; // 0..D-2 for v, D-1..2*D-3 for h
DTYPE minl, sum, l[MPOWV+1];
if (d <= 3)
@ -726,7 +726,7 @@ Tree flutes_LD(int d, DTYPE xs[], DTYPE ys[], int s[])
{
int k, pi, i, j;
struct csoln *rlist, *bestrlist;
DTYPE dd[2*D-2]; // 0..D-2 for v, D-1..2*D-3 for h
DTYPE dd[2*DPARAM-2]; // 0..D-2 for v, D-1..2*D-3 for h
DTYPE minl, sum, l[MPOWV+1];
int hflip;
Tree t;
@ -1340,8 +1340,8 @@ void local_refinement(Tree *tp, int p)
{
int d, dd, i, ii, j, prev, curr, next, root;
int SteinerPin[2*MAXD], index[2*MAXD];
DTYPE x[MAXD], xs[D], ys[D];
int ss[D];
DTYPE x[MAXD], xs[DPARAM], ys[DPARAM];
int ss[DPARAM];
Tree tt;
d = tp->deg;
@ -1387,7 +1387,7 @@ void local_refinement(Tree *tp, int p)
}
}
if (4 <= dd && dd <= D) {
if (4 <= dd && dd <= DPARAM) {
// Find Steiner nodes that are directly connected to root
ii=dd;
for (i=0; i<dd; i++) {

View File

@ -41,7 +41,7 @@ namespace Flute {
/*************************************/
#define POWVFILE "POWV9.dat" // LUT for POWV (Wirelength Vector)
#define POSTFILE "POST9.dat" // LUT for POST (Steiner Tree)
#define D 9 // LUT is used for d <= D, D <= 9
#define DPARAM 9 // LUT is used for d <= D, D <= 9
#define TAU(A) (8+1.3*(A))
#define D1(A) (25+120/((A)*(A))) // flute_mr is used for D1 < d <= D2
#define D2(A) ((A)<=6 ? 500 : 75+5*(A))
@ -89,14 +89,14 @@ extern Tree flutes_RDP(int d, DTYPE xs[], DTYPE ys[], int s[], int acc);
#define flutes_wl_ALLD(d, xs, ys, s, acc) flutes_wl_LMD(d, xs, ys, s, acc)
#define flutes_ALLD(d, xs, ys, s, acc) \
(d<=D ? flutes_LD(d, xs, ys, s) \
(d<=DPARAM ? flutes_LD(d, xs, ys, s) \
: (d<=D1(acc) ? flutes_MD(d, xs, ys, s, acc) \
: flutes_HD(d, xs, ys, s, acc)))
#define flutes_wl_LMD(d, xs, ys, s, acc) \
(d<=D ? flutes_wl_LD(d, xs, ys, s) : flutes_wl_MD(d, xs, ys, s, acc))
(d<=DPARAM ? flutes_wl_LD(d, xs, ys, s) : flutes_wl_MD(d, xs, ys, s, acc))
#define flutes_LMD(d, xs, ys, s, acc) \
(d<=D ? flutes_LD(d, xs, ys, s) : flutes_MD(d, xs, ys, s, acc))
(d<=DPARAM ? flutes_LD(d, xs, ys, s) : flutes_MD(d, xs, ys, s, acc))
//#define max(x,y) ((x)>(y)?(x):(y))
//#define min(x,y) ((x)<(y)?(x):(y))

View File

@ -21,7 +21,7 @@ namespace Flute {
#define MR_FOR_SMALL_CASES_ONLY 1
#if MR_FOR_SMALL_CASES_ONLY
#define MAXPART D2M // max partition of an MST
#define MAXT (D2M/D*2)
#define MAXT (D2M/DPARAM*2)
#else
#define MAXPART (d/9*2) //(MAXD/THD*2) // max partition of an MST
#define MAXPART2 ((t1.deg+t2.deg)/9*2)