~chaffra/+junk/trilinos

« back to all changes in this revision

Viewing changes to packages/zoltan/src/util/converters_for_JPDC_adaptive_mesh_experiments/exo2chaco/chaco/coarsen/maxmatch.c

  • Committer: Bazaar Package Importer
  • Author(s): Christophe Prud'homme, Christophe Prud'homme, Johannes Ring
  • Date: 2009-12-13 12:53:22 UTC
  • mfrom: (5.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20091213125322-in0nrdjc55deqsw9
Tags: 10.0.3.dfsg-1
[Christophe Prud'homme]
* New upstream release

[Johannes Ring]
* debian/patches/libname.patch: Add prefix 'libtrilinos_' to all
  libraries. 
* debian/patches/soname.patch: Add soversion to libraries.
* debian/watch: Update download URL.
* debian/control:
  - Remove python-numeric from Build-Depends (virtual package).
  - Remove automake and autotools from Build-Depends and add cmake to
    reflect switch to CMake.
  - Add python-support to Build-Depends.
* debian/rules: 
  - Cleanup and updates for switch to CMake.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* This software was developed by Bruce Hendrickson and Robert Leland   *
 
2
 * at Sandia National Laboratories under US Department of Energy        *
 
3
 * contract DE-AC04-76DP00789 and is copyrighted by Sandia Corporation. */
 
4
 
 
5
#include <stdio.h>
 
6
#include "defs.h"
 
7
#include "structs.h"
 
8
 
 
9
 
 
10
/* Find a maximal matching in a graph using one of several algorithms. */
 
11
 
 
12
int       maxmatch(graph, nvtxs, nedges, mflag, using_ewgts, igeom, coords)
 
13
struct vtx_data **graph;        /* array of vtx data for graph */
 
14
int       nvtxs;                /* number of vertices in graph */
 
15
int       nedges;               /* number of edges in graph */
 
16
int      *mflag;                /* flag indicating vtx selected or not */
 
17
int       using_ewgts;          /* are edge weights being used? */
 
18
int       igeom;                /* geometric dimensionality */
 
19
float   **coords;               /* coordinates for each vertex */
 
20
{
 
21
    extern int DEBUG_COARSEN;   /* debug output for coarsening? */
 
22
    extern int MATCH_TYPE;      /* which matching routine to use */
 
23
    int       nmerged;          /* number of matching edges found */
 
24
    int       maxmatch1(), maxmatch2(), maxmatch3(), maxmatch4();
 
25
    int       maxmatch5(), maxmatch9();
 
26
 
 
27
    if (MATCH_TYPE == 1) {      /* Dumb, fast routine. */
 
28
        nmerged = maxmatch1(graph, nvtxs, mflag, using_ewgts);
 
29
    }
 
30
 
 
31
    else if (MATCH_TYPE == 2) { /* More random but somewhat slower. */
 
32
        nmerged = maxmatch2(graph, nvtxs, mflag, using_ewgts);
 
33
    }
 
34
 
 
35
    else if (MATCH_TYPE == 3) { /* Much more random but slower still. */
 
36
        nmerged = maxmatch3(graph, nvtxs, mflag, using_ewgts);
 
37
    }
 
38
 
 
39
    else if (MATCH_TYPE == 4) { /* Truly random but very slow. */
 
40
        nmerged = maxmatch4(graph, nvtxs, nedges, mflag, using_ewgts);
 
41
    }
 
42
    else if (MATCH_TYPE == 5) { /* Geometric nearness. */
 
43
        nmerged = maxmatch5(graph, nvtxs, mflag, igeom, coords);
 
44
    }
 
45
 
 
46
    else if (MATCH_TYPE == 9) { /* Minimum degree of merged vertex */
 
47
        nmerged = maxmatch9(graph, nvtxs, mflag, using_ewgts);
 
48
    }
 
49
 
 
50
    if (DEBUG_COARSEN > 0) {
 
51
        printf("Number of matching edges = %d\n", nmerged);
 
52
    }
 
53
 
 
54
    return (nmerged);
 
55
}