Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#include "Graph.h"
struct opts Options;
int main(int argc, char **argv) {
struct biparthypergraph HG;
long t, NrVertices, NrNets, NrPins;
printf("Test CreateNewBiPartHyperGraph: ");
NrVertices = 17;
NrNets = 95;
NrPins = 200;
if (!CreateNewBiPartHyperGraph(NrVertices, NrNets, NrPins, TRUE , 'C', &HG)) {
printf("Error\n");
exit(1);
}
/* Check result value */
if (HG.NrVertices != NrVertices ||
HG.NrNets != NrNets ||
HG.NrPins != NrPins ||
HG.CurComm != 0 ||
HG.MinComm != 0 ||
HG.OptComm != 0 ||
HG.SplitDir != ROW ||
HG.CurVtxLog != 0 ||
HG.MinVtxLog != 0 ||
HG.WeightP[0] != 0 ||
HG.WeightP[1] != 0 ||
HG.GBVtx[0].NrBuckets != 0 ||
HG.GBVtx[1].NrBuckets != 0 ||
HG.GBVtx[0].Root != NULL ||
HG.GBVtx[1].Root != NULL ) {
printf("Error\n");
exit(1);
}
/* Check vertex values */
for (t=0; t<NrVertices; t++){
if (HG.V[t].vtxwgt != 0 ||
HG.V[t].iStart != 0 ||
HG.V[t].iEnd != 0 ||
HG.V[t].partition != 0 ||
HG.V[t].GBentry != NULL ||
HG.Vtx2MatIndex[t] != 0 ||
HG.OptPartVtx[t] != 0) {
printf("Error\n");
exit(1);
}
}
/* Check net values */
for (t=0; t<NrNets; t++){
if (HG.N[t].netwgt != 0 ||
HG.N[t].iStartP0 != 0 ||
HG.N[t].iStartP1 != 0 ||
HG.N[t].iEnd != 0 ||
HG.N[t].dir != ROW ||
HG.Net2MatIndex[t] != 0) {
printf("Error\n");
exit(1);
}
}
/* Check pin values */
for (t=0; t<NrPins; t++){
if (HG.VtxAdjncy[t] != 0 ||
HG.NetAdjncy[t] != 0 ||
HG.MatReValue[t] != 0.0 ||
HG.MatImValue[t] != 0.0) {
printf("Error\n");
exit(1);
}
}
printf("OK\n");
exit(0);
} /* end main */