116 const SCOTCH_Num * vwgt2;
117 const SCOTCH_Num * vsize2;
122 const SCOTCH_Num * edgetax;
123 const SCOTCH_Num * parttax;
124 SCOTCH_Num * nghbtab;
127 vsize2 = ((*wgtflag & 1) != 0) ? vsize : NULL;
128 vwgt2 = ((*wgtflag & 2) != 0) ? vwgt : NULL;
131 edgetax = adjncy - baseval;
134 if (vsize2 == NULL) {
135 if (
PartGraph2 (n, xadj, adjncy, vwgt2, NULL, numflag, nparts,
136 part, SCOTCH_STRATDEFAULT, 0.01) != 0)
142 const SCOTCH_Num * vsiztax;
144 SCOTCH_Num * edlotax;
147 edgenbr = xadj[vertnbr] - baseval;
149 (SCOTCH_Num*) malloc (edgenbr *
sizeof (SCOTCH_Num))) == NULL)
155 vsiztax = vsize2 - baseval;
158 for (vertnum = 0, edgenum = baseval;
159 vertnum < vertnbr; vertnum ++) {
163 vsizval = vsize2[vertnum];
165 for (edgennd = xadj[vertnum + 1];
171 vertend = edgetax[edgenum];
172 edlotax[edgenum] = vsizval + vsiztax[vertend];
176 o =
PartGraph2 (n, xadj, adjncy, vwgt2, edlotax + baseval, numflag,
177 nparts, part, SCOTCH_STRATDEFAULT, 0.01);
179 free (edlotax + baseval);
186 (SCOTCH_Num*) malloc (*nparts *
sizeof (SCOTCH_Num))) == NULL)
191 memset (nghbtab, ~0, *nparts *
sizeof (SCOTCH_Num));
193 parttax = part - baseval;
197 for (vertnum = 0, edgenum = baseval, commvol = 0;
198 vertnum < vertnbr; vertnum ++) {
202 partval = part[vertnum];
203 nghbtab[partval] = vertnum;
206 vsizval = vsize2[vertnum];
209 for (edgennd = xadj[vertnum + 1]; edgenum < edgennd; edgenum ++) {
213 vertend = edgetax[edgenum];
214 partend = parttax[vertend];
217 if (nghbtab[partend] != vertnum) {
218 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)