2
* -- SuperLU routine (version 2.0) --
3
* Univ. of California Berkeley, Xerox Palo Alto Research Center,
4
* and Lawrence Berkeley National Lab.
9
Copyright (c) 1994 by Xerox Corporation. All rights reserved.
11
THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
12
EXPRESSED OR IMPLIED. ANY USE IS AT YOUR OWN RISK.
14
Permission is hereby granted to use or copy this program for any
15
purpose, provided the above notices are retained on all copies.
16
Permission to modify the code and to distribute modified code is
17
granted, provided the above notices are retained, and a notice that
18
the code was modified is included with the above copyright notice.
26
int *et, /* column elimination tree */
27
const int relax_columns, /* max no of columns allowed in a
29
int *descendants, /* no of descendants of each node
31
int *relax_end /* last column in a supernode */
37
* relax_snode() - Identify the initial relaxed supernodes, assuming that
38
* the matrix has been reordered according to the postorder of the etree.
41
register int j, parent;
42
register int snode_start; /* beginning of a snode */
44
ifill (relax_end, n, EMPTY);
45
for (j = 0; j < n; j++) descendants[j] = 0;
47
/* Compute the number of descendants of each node in the etree */
48
for (j = 0; j < n; j++) {
50
if ( parent != n ) /* not the dummy root */
51
descendants[parent] += descendants[j] + 1;
54
/* Identify the relaxed supernodes by postorder traversal of the etree. */
55
for (j = 0; j < n; ) {
58
while ( parent != n && descendants[parent] < relax_columns ) {
62
/* Found a supernode with j being the last column. */
63
relax_end[snode_start] = j; /* Last column is recorded */
65
/* Search for a new leaf */
66
while ( descendants[j] != 0 && j < n ) j++;
69
/*printf("No of relaxed snodes: %d; relaxed columns: %d\n",
70
nsuper, no_relaxed_col); */