4
* -- SuperLU routine (version 2.0) --
5
* Univ. of California Berkeley, Xerox Palo Alto Research Center,
6
* and Lawrence Berkeley National Lab.
11
Copyright (c) 1994 by Xerox Corporation. All rights reserved.
13
THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
14
EXPRESSED OR IMPLIED. ANY USE IS AT YOUR OWN RISK.
16
Permission is hereby granted to use or copy this program for any
17
purpose, provided the above notices are retained on all copies.
18
Permission to modify the code and to distribute modified code is
19
granted, provided the above notices are retained, and a notice that
20
the code was modified is included with the above copyright notice.
28
const int jcol, /* in */
29
const int *perm_r, /* in */
30
const int pivrow, /* in */
31
const int nseg, /* in */
32
const int *segrep, /* in */
33
const int *repfnz, /* in */
34
int *xprune, /* out */
35
GlobalLU_t *Glu /* modified - global LU data structures */
41
* Prunes the L-structure of supernodes whose L-structure
42
* contains the current pivot row "pivrow"
46
int jsupno, irep, irep1, kmin, kmax, krow, movnum;
47
int i, ktemp, minloc, maxloc;
48
int do_prune; /* logical variable */
62
* For each supernode-rep irep in U[*,j]
65
for (i = 0; i < nseg; i++) {
71
/* Don't prune with a zero U-segment */
72
if ( repfnz[irep] == EMPTY )
75
/* If a snode overlaps with the next panel, then the U-segment
76
* is fragmented into two parts -- irep and irep1. We should let
77
* pruning occur at the rep-column in irep1's snode.
79
if ( supno[irep] == supno[irep1] ) /* Don't prune */
83
* If it has not been pruned & it has a nonz in row L[pivrow,i]
85
if ( supno[irep] != jsupno ) {
86
if ( xprune[irep] >= xlsub[irep1] ) {
88
kmax = xlsub[irep1] - 1;
89
for (krow = kmin; krow <= kmax; krow++)
90
if ( lsub[krow] == pivrow ) {
98
/* Do a quicksort-type partition
99
* movnum=TRUE means that the num values have to be exchanged.
102
if ( irep == xsup[supno[irep]] ) /* Snode of size 1 */
105
while ( kmin <= kmax ) {
107
if ( perm_r[lsub[kmax]] == EMPTY )
109
else if ( perm_r[lsub[kmin]] != EMPTY )
111
else { /* kmin below pivrow, and kmax above pivrow:
112
* interchange the two subscripts
115
lsub[kmin] = lsub[kmax];
118
/* If the supernode has only one column, then we
119
* only keep one set of subscripts. For any subscript
120
* interchange performed, similar interchange must be
121
* done on the numerical values.
124
minloc = xlusup[irep] + (kmin - xlsub[irep]);
125
maxloc = xlusup[irep] + (kmax - xlsub[irep]);
126
utemp = lusup[minloc];
127
lusup[minloc] = lusup[maxloc];
128
lusup[maxloc] = utemp;
138
xprune[irep] = kmin; /* Pruning */
141
printf(" After cpruneL(),using col %d: xprune[%d] = %d\n",
148
} /* for each U-segment... */