3
/// This file is part of Rheolef.
5
/// Copyright (C) 2000-2009 Pierre Saramito <Pierre.Saramito@imag.fr>
7
/// Rheolef is free software; you can redistribute it and/or modify
8
/// it under the terms of the GNU General Public License as published by
9
/// the Free Software Foundation; either version 2 of the License, or
10
/// (at your option) any later version.
12
/// Rheolef is distributed in the hope that it will be useful,
13
/// but WITHOUT ANY WARRANTY; without even the implied warranty of
14
/// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
/// GNU General Public License for more details.
17
/// You should have received a copy of the GNU General Public License
18
/// along with Rheolef; if not, write to the Free Software
19
/// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21
/// =========================================================================
23
/* genrcm.f -- translated by f2c (version 19931217).*/
25
/*****************************************************************/
26
/*****************************************************************/
27
/********* GENRCM ..... GENERAL REVERSE CUTHILL MCKEE ********/
28
/*****************************************************************/
30
/* PURPOSE - GENRCM FINDS THE REVERSE CUTHILL-MCKEE*/
31
/* ORDERING FOR A GENERAL GRAPH. FOR EACH CONNECTED*/
32
/* COMPONENT IN THE GRAPH, GENRCM OBTAINS THE ORDERING*/
33
/* BY CALLING THE SUBROUTINE RCM.*/
35
/* INPUT PARAMETERS -*/
36
/* NEQNS - NUMBER OF EQUATIONS*/
37
/* (XADJ, ADJNCY) - ARRAY PAIR CONTAINING THE ADJACENCY*/
38
/* STRUCTURE OF THE GRAPH OF THE MATRIX.*/
40
/* OUTPUT PARAMETER -*/
41
/* PERM - VECTOR THAT CONTAINS THE RCM ORDERING.*/
43
/* WORKING PARAMETERS -*/
44
/* MASK - IS USED TO MARK VARIABLES THAT HAVE BEEN*/
45
/* NUMBERED DURING THE ORDERING PROCESS. IT IS*/
46
/* INITIALIZED TO 1, AND SET TO ZERO AS EACH NODE*/
48
/* XLS - THE INDEX VECTOR FOR A LEVEL STRUCTURE. THE*/
49
/* LEVEL STRUCTURE IS STORED IN THE CURRENTLY*/
50
/* UNUSED SPACES IN THE PERMUTATION VECTOR PERM.*/
52
/* PROGRAM SUBROUTINES -*/
54
/*****************************************************************/
56
#include "rheolef/fnroot.h"
57
#include "rheolef/rcm.h"
59
template <class Size, class Iterator>
69
typedef typename std::iterator_traits<Iterator>::value_type Integer;
71
/* System generated locals */
75
static Integer nlvl, root, i, ccsize;
78
/* Parameter adjustments */
86
for (i = 1; i <= i__1; ++i) {
91
for (i = 1; i <= i__1; ++i) {
92
/* FOR EACH MASKED CONNECTED COMPONENT ...*/
97
/* FIRST FIND A PSEUDO-PERIPHERAL NODE ROOT.*/
98
/* NOTE THAT THE LEVEL STRUCTURE FOUND BY*/
99
/* FNROOT IS STORED STARTING AT PERM(NUM).*/
100
/* THEN RCM IS CALLED TO ORDER THE COMPONENT*/
101
/* USING ROOT AS THE STARTING NODE.*/
103
fnroot(&root, &xadj[1], &adjncy[1], &mask[1], &nlvl, &xls[1], &perm[num]);
104
rcm(&root, &xadj[1], &adjncy[1], &mask[1], &perm[num], &ccsize, &xls[1]);