115 const SCOTCH_Num * vwgt2;
116 const SCOTCH_Num * vsize2;
121 const SCOTCH_Num * edgetax;
122 const SCOTCH_Num * parttax;
123 SCOTCH_Num * nghbtab;
126 vsize2 = ((*wgtflag & 1) != 0) ? vsize : NULL;
127 vwgt2 = ((*wgtflag & 2) != 0) ? vwgt : NULL;
130 edgetax = adjncy - baseval;
133 if (vsize2 == NULL) {
134 if (
PartGraph2 (n, xadj, adjncy, vwgt2, NULL, numflag, nparts,
135 part, SCOTCH_STRATDEFAULT, 0.01) != 0)
141 const SCOTCH_Num * vsiztax;
143 SCOTCH_Num * edlotax;
146 edgenbr = xadj[vertnbr] - baseval;
148 (SCOTCH_Num*) malloc (edgenbr *
sizeof (SCOTCH_Num))) == NULL)
154 vsiztax = vsize2 - baseval;
157 for (vertnum = 0, edgenum = baseval;
158 vertnum < vertnbr; vertnum ++) {
162 vsizval = vsize2[vertnum];
164 for (edgennd = xadj[vertnum + 1];
170 vertend = edgetax[edgenum];
171 edlotax[edgenum] = vsizval + vsiztax[vertend];
175 o =
PartGraph2 (n, xadj, adjncy, vwgt2, edlotax + baseval, numflag,
176 nparts, part, SCOTCH_STRATDEFAULT, 0.01);
178 free (edlotax + baseval);
185 (SCOTCH_Num*) malloc (*nparts *
sizeof (SCOTCH_Num))) == NULL)
190 memset (nghbtab, ~0, *nparts *
sizeof (SCOTCH_Num));
192 parttax = part - baseval;
196 for (vertnum = 0, edgenum = baseval, commvol = 0;
197 vertnum < vertnbr; vertnum ++) {
201 partval = part[vertnum];
202 nghbtab[partval] = vertnum;
205 vsizval = vsize2[vertnum];
208 for (edgennd = xadj[vertnum + 1]; edgenum < edgennd; edgenum ++) {
212 vertend = edgetax[edgenum];
213 partend = parttax[vertend];
216 if (nghbtab[partend] != vertnum) {
217 nghbtab[partend] = vertnum;
int PartGraph2(const SCOTCH_Num *const n, const SCOTCH_Num *const xadj, const SCOTCH_Num *const adjncy, const SCOTCH_Num *const vwgt, const SCOTCH_Num *const adjwgt, const SCOTCH_Num *const numflag, const SCOTCH_Num *const nparts, SCOTCH_Num *const part, SCOTCH_Num flagval, double kbalval)