~ubuntu-branches/ubuntu/trusty/scotch/trusty-proposed

« back to all changes in this revision

Viewing changes to src/libscotch/bgraph_bipart_ml.c

  • Committer: Bazaar Package Importer
  • Author(s): "Adam C. Powell, IV", Christophe Trophime, Adam C. Powell, IV
  • Date: 2010-12-29 13:07:19 UTC
  • mfrom: (1.1.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20101229130719-jwalolw5d6av6wqx
Tags: 5.1.11.dfsg-1
[Christophe Trophime]
* New upstream release
* Forward-ported patches to version 5.1.10b.
* Install scotch headers properly.
* Fix chrpath commands in debian/rules.
* Fix (pt)scotch library install paths.
* Fix lintian errors and warnings.

[Adam C. Powell, IV]
* Forward-ported patches to version 5.1.11.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright 2004,2007-2009 ENSEIRB, INRIA & CNRS
 
1
/* Copyright 2004,2007-2010 ENSEIRB, INRIA & CNRS
2
2
**
3
3
** This file is part of the Scotch software package for static mapping,
4
4
** graph partitioning and sparse matrix ordering.
50
50
/**                # Version 4.0  : from : 12 dec 2003     **/
51
51
/**                                 to     20 mar 2005     **/
52
52
/**                # Version 5.1  : from : 28 sep 2008     **/
53
 
/**                                 to     18 nov 2009     **/
 
53
/**                                 to     13 jul 2010     **/
54
54
/**                                                        **/
55
55
/************************************************************/
56
56
 
94
94
GraphCoarsenMulti * restrict * const  coarmultptr, /*+ Pointer to multinode table to build +*/
95
95
const BgraphBipartMlParam * const     paraptr)    /*+ Method parameters                    +*/
96
96
{
97
 
  if (graphCoarsen (&finegrafptr->s, &coargrafptr->s, coarmultptr, paraptr->coarnbr, paraptr->coarrat, paraptr->matchtype) != 0)
 
97
  if (graphCoarsen (&finegrafptr->s, &coargrafptr->s, coarmultptr,
 
98
                    paraptr->coarnbr, paraptr->coarrat, paraptr->coartype) != 0)
98
99
    return (1);                                   /* Return if coarsening failed */
99
100
 
100
101
  if (finegrafptr->veextax != NULL) {             /* Merge external gains for coarsened vertices */
162
163
const GraphCoarsenMulti * const coarmulttax)      /*+ Pointer to multinode array +*/
163
164
{
164
165
  GraphPart * restrict        fineparttax;
165
 
  Gnum                        finefronnum;
 
166
  Gnum                        finefronnbr;
166
167
  Gnum                        finecompsize1;
167
168
  const GraphPart * restrict  coarparttax;
168
169
  Gnum                        coarvertnum;
213
214
  finegrafptr->commload     = coargrafptr->commload;
214
215
  finegrafptr->commgainextn = coargrafptr->commgainextn;
215
216
 
216
 
  for (coarfronnum = 0, finefronnum = coargrafptr->fronnbr; /* Re-cycle frontier array from coarse to fine graph */
 
217
  for (coarfronnum = 0, finefronnbr = coargrafptr->fronnbr; /* Re-cycle frontier array from coarse to fine graph */
217
218
       coarfronnum < coargrafptr->fronnbr; coarfronnum ++) {
218
219
    Gnum                coarvertnum;
219
220
    Gnum                finevertnum0;             /* First multinode vertex  */
224
225
    finevertnum1 = coarmulttax[coarvertnum].vertnum[1];
225
226
      
226
227
    if (finevertnum0 != finevertnum1) {           /* If multinode si made of two distinct vertices */
227
 
      Gnum                coarpartval;
 
228
      GraphPart           coarpartval;
228
229
      Gnum                fineedgenum;
229
230
 
230
231
      coarpartval = coarparttax[coarvertnum];
248
249
      for (fineedgenum = fineverttax[finevertnum1]; /* Check if second vertex belong to frontier too */
249
250
           fineedgenum < finevendtax[finevertnum1]; fineedgenum ++) {
250
251
        if (fineparttax[fineedgetax[fineedgenum]] != coarpartval) { /* If second vertex belongs to frontier  */
251
 
          coarfrontab[finefronnum ++] = finevertnum1; /* Record it at the end of the recycled frontier array */
 
252
          coarfrontab[finefronnbr ++] = finevertnum1; /* Record it at the end of the recycled frontier array */
252
253
          break;
253
254
        }
254
255
      }
263
264
    else                                          /* If coarse vertex is single node */
264
265
      coarfrontab[coarfronnum] = finevertnum0;    /* Then it belongs to the frontier */
265
266
  }
266
 
  finegrafptr->fronnbr = finefronnum;
 
267
  finegrafptr->fronnbr = finefronnbr;
267
268
 
268
269
#ifdef SCOTCH_DEBUG_BGRAPH2
269
270
  if (bgraphCheck (finegrafptr) != 0) {