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

« back to all changes in this revision

Viewing changes to src/libscotch/dgraph_build_grid3d.h

  • 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 2010 ENSEIRB, INRIA & CNRS
 
2
**
 
3
** This file is part of the Scotch software package for static mapping,
 
4
** graph partitioning and sparse matrix ordering.
 
5
**
 
6
** This software is governed by the CeCILL-C license under French law
 
7
** and abiding by the rules of distribution of free software. You can
 
8
** use, modify and/or redistribute the software under the terms of the
 
9
** CeCILL-C license as circulated by CEA, CNRS and INRIA at the following
 
10
** URL: "http://www.cecill.info".
 
11
** 
 
12
** As a counterpart to the access to the source code and rights to copy,
 
13
** modify and redistribute granted by the license, users are provided
 
14
** only with a limited warranty and the software's author, the holder of
 
15
** the economic rights, and the successive licensors have only limited
 
16
** liability.
 
17
** 
 
18
** In this respect, the user's attention is drawn to the risks associated
 
19
** with loading, using, modifying and/or developing or reproducing the
 
20
** software by the user in light of its specific status of free software,
 
21
** that may mean that it is complicated to manipulate, and that also
 
22
** therefore means that it is reserved for developers and experienced
 
23
** professionals having in-depth computer knowledge. Users are therefore
 
24
** encouraged to load and test the software's suitability as regards
 
25
** their requirements in conditions enabling the security of their
 
26
** systems and/or data to be ensured and, more generally, to use and
 
27
** operate it in the same conditions as regards security.
 
28
** 
 
29
** The fact that you are presently reading this means that you have had
 
30
** knowledge of the CeCILL-C license and that you accept its terms.
 
31
*/
 
32
/************************************************************/
 
33
/**                                                        **/
 
34
/**   NAME       : dgraph_build_grid3d.h                   **/
 
35
/**                                                        **/
 
36
/**   AUTHOR     : Francois PELLEGRINI                     **/
 
37
/**                                                        **/
 
38
/**   FUNCTION   : This file contains the data             **/
 
39
/**                declarations for the distributed 3D     **/
 
40
/**                grid graph building routine.            **/
 
41
/**                                                        **/
 
42
/**   DATES      : # Version 5.1  : from : 06 jun 2010     **/
 
43
/**                                 to   : 04 nov 2010     **/
 
44
/**                                                        **/
 
45
/************************************************************/
 
46
 
 
47
/*
 
48
** The type and structure definitions.
 
49
*/
 
50
 
 
51
/*+ The multinode table element, which contains
 
52
    pairs of based indices of collapsed vertices.
 
53
    Both values are equal for uncollapsed vertices. +*/
 
54
 
 
55
typedef struct DgraphBuildGrid3DData_ {
 
56
  Gnum                      baseval;
 
57
  Gnum                      dimxval;
 
58
  Gnum                      dimyval;
 
59
  Gnum                      dimzval;
 
60
  Gnum *                    edgeloctax;
 
61
  Gnum *                    edloloctax;
 
62
  Gnum                   (* funcvrtptr) (const struct DgraphBuildGrid3DData_ * restrict const, const Gnum, Gnum, const Gnum, const Gnum, const Gnum);
 
63
  struct {                                        /* Pre-computed data for 26-neighbor torus */
 
64
    Gnum                    ngbxmin;
 
65
    Gnum                    ngbxmax;
 
66
    Gnum                    ngbymin;
 
67
    Gnum                    ngbymax;
 
68
    Gnum                    ngbzmin;
 
69
    Gnum                    ngbzmax;
 
70
  } t26;
 
71
} DgraphBuildGrid3DData;
 
72
 
 
73
/*
 
74
** The function prototypes.
 
75
*/
 
76
 
 
77
#ifndef DGRAPH_BUILD_GRID3D
 
78
#define static
 
79
#endif
 
80
 
 
81
static Gnum                 dgraphBuildGrid3Dvertex26M (const DgraphBuildGrid3DData * restrict const, const Gnum, Gnum, const Gnum, const Gnum, const Gnum);
 
82
static Gnum                 dgraphBuildGrid3Dvertex26T (const DgraphBuildGrid3DData * restrict const, const Gnum, Gnum, const Gnum, const Gnum, const Gnum);
 
83
static Gnum                 dgraphBuildGrid3Dvertex6M (const DgraphBuildGrid3DData * restrict const, const Gnum, Gnum, const Gnum, const Gnum, const Gnum);
 
84
static Gnum                 dgraphBuildGrid3Dvertex6T (const DgraphBuildGrid3DData * restrict const, const Gnum, Gnum, const Gnum, const Gnum, const Gnum);
 
85
 
 
86
#undef static
 
87
 
 
88
/*
 
89
** The macro definitions.
 
90
*/
 
91
 
 
92
#define DGRAPHBUILDGRID3DNGB(d,v,e,x,y,z) {                                                                        \
 
93
                                      Gnum                edgeloctmp;                                              \
 
94
                                      Gnum                vertglbend;                                              \
 
95
                                      edgeloctmp = (e);                                                            \
 
96
                                      vertglbend = ((z) * (d)->dimyval + (y)) * (d)->dimxval + (x) + (d)->baseval; \
 
97
                                      (d)->edgeloctax[edgeloctmp] = vertglbend;                                    \
 
98
                                      if ((d)->edloloctax != NULL)                                                 \
 
99
                                        (d)->edloloctax[edgeloctmp] = ((vertglbend + (v)) % 16) + 1;               \
 
100
                                    }
 
101