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

« back to all changes in this revision

Viewing changes to src/scotch/gout_c.h

  • Committer: Bazaar Package Importer
  • Author(s): Christophe Prud'homme
  • Date: 2008-01-25 09:13:53 UTC
  • Revision ID: james.westby@ubuntu.com-20080125091353-zghdao60dfsyc2bt
Tags: upstream-5.0.1.dfsg
ImportĀ upstreamĀ versionĀ 5.0.1.dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Copyright 2004,2007 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       : gout_c.h                                **/
 
35
/**                                                        **/
 
36
/**   AUTHOR     : Francois PELLEGRINI                     **/
 
37
/**                                                        **/
 
38
/**   FUNCTION   : Part of a result viewer.                **/
 
39
/**                This module contains the data declara-  **/
 
40
/**                tions for the main module.              **/
 
41
/**                                                        **/
 
42
/**   DATES      : # Version 2.0  : from : 06 oct 1994     **/
 
43
/**                                 to     01 nov 1994     **/
 
44
/**                # Version 3.0  : from : 14 jul 1995     **/
 
45
/**                                 to     02 oct 1995     **/
 
46
/**                # Version 3.2  : from : 02 dec 1996     **/
 
47
/**                                 to     05 jun 1998     **/
 
48
/**                # Version 3.3  : from : 01 jun 1999     **/
 
49
/**                                 to     01 jun 1999     **/
 
50
/**                # Version 4.0  : from : 11 dec 2001     **/
 
51
/**                                 to     11 dec 2001     **/
 
52
/**                                                        **/
 
53
/************************************************************/
 
54
 
 
55
/*
 
56
**  The defines.
 
57
*/
 
58
 
 
59
/*+ File name aliases. +*/
 
60
 
 
61
#define C_FILENBR                   4             /* Number of files in list                */
 
62
#define C_FILEARGNBR                4             /* Number of files which can be arguments */
 
63
 
 
64
#define C_filenamesrcinp            C_fileTab[0].name /* Source graph file name          */
 
65
#define C_filenamegeoinp            C_fileTab[1].name /* Source graph geometry file name */
 
66
#define C_filenamemapinp            C_fileTab[2].name /* Mapping result file name        */
 
67
#define C_filenamedatout            C_fileTab[3].name /* Output data file name           */
 
68
 
 
69
#define C_filepntrsrcinp            C_fileTab[0].pntr /* Source graph input file    */
 
70
#define C_filepntrgeoinp            C_fileTab[1].pntr /* Source graph geometry file */
 
71
#define C_filepntrmapinp            C_fileTab[2].pntr /* Mapping result input file  */
 
72
#define C_filepntrdatout            C_fileTab[3].pntr /* Data output file           */
 
73
 
 
74
/*+ Dimension definitions. +*/
 
75
 
 
76
#define x                           c[0]
 
77
#define y                           c[1]
 
78
#define z                           c[2]
 
79
 
 
80
/*+ Geometry flags. +*/
 
81
 
 
82
#define C_GEOFLAGDEFAULT            0x0001        /* Default geometry flag            */
 
83
#define C_GEOFLAGUSE                0x0001        /* Use geometry                     */
 
84
#define C_GEOFLAGROTATE             0x0002        /* Rotate the picture by 90 degrees */
 
85
#define C_GEOFLAGPERMUT             0x0004        /* Permute Y and Z dimensions       */
 
86
 
 
87
/*
 
88
**  The type and structure definitions.
 
89
*/
 
90
 
 
91
/*+ This structure defines a source graph. +*/
 
92
 
 
93
typedef struct C_Graph_ {
 
94
  SCOTCH_Graph            grafdat;                /*+ Source graph data  +*/
 
95
  SCOTCH_Num              baseval;                /*+ Base value         +*/
 
96
  SCOTCH_Num              vertnbr;                /*+ Number of vertices +*/
 
97
  SCOTCH_Num *            verttab;                /*+ Vertex array       +*/
 
98
  SCOTCH_Num *            vendtab;                /*+ Vertex end array   +*/
 
99
  SCOTCH_Num *            vlbltab;                /*+ Vertex label array +*/
 
100
  SCOTCH_Num              edgenbr;                /*+ Number of edges    +*/
 
101
  SCOTCH_Num *            edgetab;                /*+ Edge array         +*/
 
102
} C_Graph;
 
103
 
 
104
/*+ This structure defines a geometrical vertex. +*/
 
105
 
 
106
typedef struct C_GeoVert_ {
 
107
  double                    c[3];                 /*+ Vertex coordinates (x,y,z) +*/
 
108
} C_GeoVert;
 
109
 
 
110
/*+ This structure defines a geometrical
 
111
    mapping which contains the positions
 
112
    of the graph vertices.               +*/
 
113
 
 
114
typedef struct C_Geometry_ {
 
115
  const C_Graph *         grafptr;                /*+ Pointer to source graph      +*/
 
116
  C_GeoVert *             verttab;                /*+ Pointer to coordinates array +*/
 
117
} C_Geometry;
 
118
 
 
119
/*+ This structure defines a domain label
 
120
    mapping, which contains the reference
 
121
    to the mapping source graph.          +*/
 
122
 
 
123
typedef struct C_Mapping_ {
 
124
  const C_Graph *         grafptr;                /*+ Pointer to source graph +*/
 
125
  SCOTCH_Num *            labltab;                /*+ Pointer to label array  +*/
 
126
} C_Mapping;
 
127
 
 
128
/*+ The sort structure, used to sort graph vertices by label. +*/
 
129
 
 
130
typedef struct C_VertSort_ {
 
131
  SCOTCH_Num                labl;                 /*+ Vertex label  +*/
 
132
  SCOTCH_Num                num;                  /*+ Vertex number +*/
 
133
} C_VertSort;
 
134
 
 
135
/*+ This structure is the code
 
136
    name array entries.        +*/
 
137
 
 
138
typedef struct C_ParseCode_ {
 
139
  uint                      code;                 /*+ Code value +*/
 
140
  char *                    name;                 /*+ Code name  +*/
 
141
} C_ParseCode;
 
142
 
 
143
/* This structure defines the
 
144
   code argument array entries. */
 
145
 
 
146
typedef struct C_ParseArg_ {
 
147
  const char *              name;                 /*+ Name of the argument                         +*/
 
148
  uint                      code;                 /*+ Code value                                   +*/
 
149
  const char *              format;               /*+ scanf-like format; NULL means char, no value +*/
 
150
  const void *              ptr;                  /*+ Pointer to the argument location             +*/
 
151
  int                    (* func) ();             /*+ Pointer to the argument test function        +*/
 
152
} C_ParseArg;
 
153
 
 
154
/*
 
155
**  The global data declarations.
 
156
*/
 
157
 
 
158
extern File                 C_fileTab[C_FILENBR]; /*+ File array +*/
 
159
 
 
160
/*
 
161
**  The function prototypes.
 
162
*/
 
163
 
 
164
int                         C_geoParse          (const char * const);
 
165
void                        C_geoInit           (C_Geometry * const, const C_Graph * const);
 
166
void                        C_geoExit           (C_Geometry * const);
 
167
int                         C_geoLoad           (C_Geometry * const, FILE * const);
 
168
 
 
169
void                        C_mapInit           (C_Mapping * const, const C_Graph * const);
 
170
void                        C_mapExit           (C_Mapping * const);
 
171
int                         C_mapLoad           (C_Mapping * const, FILE * const);
 
172
 
 
173
int                         C_parse             (const C_ParseCode * const, const C_ParseArg * const, uint * const, char * const);