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

« back to all changes in this revision

Viewing changes to src/libscotch/hgraph_order_si.c

  • 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       : hgraph_order_si.c                       **/
 
35
/**                                                        **/
 
36
/**   AUTHOR     : Francois PELLEGRINI                     **/
 
37
/**                                                        **/
 
38
/**   FUNCTION   : This module orders halo graph vertices  **/
 
39
/**                using a simple method.                  **/
 
40
/**                                                        **/
 
41
/**   DATES      : # Version 3.2  : from : 01 nov 1996     **/
 
42
/**                                 to     21 aug 1998     **/
 
43
/**                # Version 3.3  : from : 02 oct 1998     **/
 
44
/**                                 to     02 oct 1998     **/
 
45
/**                # Version 4.0  : from : 19 dec 2001     **/
 
46
/**                                 to     11 dec 2002     **/
 
47
/**                                                        **/
 
48
/************************************************************/
 
49
 
 
50
/*
 
51
**  The defines and includes.
 
52
*/
 
53
 
 
54
#define HGRAPH_ORDER_SI
 
55
 
 
56
#include "module.h"
 
57
#include "common.h"
 
58
#include "graph.h"
 
59
#include "order.h"
 
60
#include "hgraph.h"
 
61
#include "hgraph_order_si.h"
 
62
 
 
63
/*****************************/
 
64
/*                           */
 
65
/* This is the main routine. */
 
66
/*                           */
 
67
/*****************************/
 
68
 
 
69
/* This routine performs the ordering.
 
70
** It returns:
 
71
** - 0   : if the ordering could be computed.
 
72
** - !0  : on error.
 
73
*/
 
74
 
 
75
int
 
76
hgraphOrderSi (
 
77
const Hgraph * restrict const   grafptr,
 
78
Order * restrict const          ordeptr,
 
79
const Gnum                      ordenum,          /*+ Zero-based ordering number +*/
 
80
OrderCblk * restrict const      cblkptr)          /*+ Single column-block        +*/
 
81
{
 
82
  Gnum                vertnum;
 
83
  Gnum                vnumnum;
 
84
 
 
85
  if (grafptr->s.vnumtax == NULL) {               /* If graph is original graph */
 
86
    for (vertnum = grafptr->s.baseval, vnumnum = ordenum;
 
87
         vertnum < grafptr->vnohnnd; vertnum ++, vnumnum ++)
 
88
      ordeptr->peritab[vnumnum] = vertnum;
 
89
  }
 
90
  else {                                          /* Graph is not original graph */
 
91
    for (vertnum = grafptr->s.baseval, vnumnum = ordenum;
 
92
         vertnum < grafptr->vnohnnd; vertnum ++, vnumnum ++)
 
93
      ordeptr->peritab[vnumnum] = grafptr->s.vnumtax[vertnum];
 
94
  }
 
95
 
 
96
  return (0);
 
97
}