2
SUBROUTINE SSLI2 (N, B, X, NEL, IEL, JEL, EL)
3
C***BEGIN PROLOGUE SSLI2
4
C***PURPOSE SLAP Lower Triangle Matrix Backsolve.
5
C Routine to solve a system of the form Lx = b , where L
6
C is a lower triangular matrix.
7
C***LIBRARY SLATEC (SLAP)
9
C***TYPE SINGLE PRECISION (SSLI2-S, DSLI2-D)
10
C***KEYWORDS ITERATIVE PRECONDITION, LINEAR SYSTEM SOLVE, SLAP, SPARSE
11
C***AUTHOR Greenbaum, Anne, (Courant Institute)
12
C Seager, Mark K., (LLNL)
13
C Lawrence Livermore National Laboratory
15
C Livermore, CA 94550 (510) 423-3141
20
C INTEGER N, NEL, IEL(NEL), JEL(NEL)
21
C REAL B(N), X(N), EL(NEL)
23
C CALL SSLI2( N, B, X, NEL, IEL, JEL, EL )
27
C Order of the Matrix.
29
C Right hand side vector.
33
C Number of non-zeros in the EL array.
34
C IEL :IN Integer IEL(NEL).
35
C JEL :IN Integer JEL(NEL).
36
C EL :IN Real EL(NEL).
37
C IEL, JEL, EL contain the unit lower triangular factor of
38
C the incomplete decomposition of the A matrix stored in
39
C SLAP Row format. The diagonal of ones *IS* stored. This
40
C structure can be set up by the SS2LT routine. See the
41
C "Description", below, for more details about the SLAP Row
45
C This routine is supplied with the SLAP package as a routine
46
C to perform the MSOLVE operation in the SIR iteration routine
47
C for the driver routine SSGS. It must be called via the SLAP
48
C MSOLVE calling sequence convention interface routine SSLI.
49
C **** THIS ROUTINE ITSELF DOES NOT CONFORM TO THE ****
50
C **** SLAP MSOLVE CALLING CONVENTION ****
52
C ==================== S L A P Row format ====================
54
C This routine requires that the matrix A be stored in the
55
C SLAP Row format. In this format the non-zeros are stored
56
C counting across rows (except for the diagonal entry, which
57
C must appear first in each "row") and are stored in the real
58
C array A. In other words, for each row in the matrix put the
59
C diagonal entry in A. Then put in the other non-zero
60
C elements going across the row (except the diagonal) in
61
C order. The JA array holds the column index for each
62
C non-zero. The IA array holds the offsets into the JA, A
63
C arrays for the beginning of each row. That is,
64
C JA(IA(IROW)), A(IA(IROW)) points to the beginning of the
65
C IROW-th row in JA and A. JA(IA(IROW+1)-1), A(IA(IROW+1)-1)
66
C points to the end of the IROW-th row. Note that we always
67
C have IA(N+1) = NELT+1, where N is the number of rows in
68
C the matrix and NELT is the number of non-zeros in the
71
C Here is an example of the SLAP Row storage format for a 5x5
72
C Matrix (in the A and JA arrays '|' denotes the end of a row):
74
C 5x5 Matrix SLAP Row format for 5x5 matrix on left.
75
C 1 2 3 4 5 6 7 8 9 10 11
76
C |11 12 0 0 15| A: 11 12 15 | 22 21 | 33 35 | 44 | 55 51 53
77
C |21 22 0 0 0| JA: 1 2 5 | 2 1 | 3 5 | 4 | 5 1 3
78
C | 0 0 33 0 35| IA: 1 4 6 8 9 12
82
C With the SLAP Row format the "inner loop" of this routine
83
C should vectorize on machines with hardware support for
84
C vector gather/scatter operations. Your compiler may require
85
C a compiler directive to convince it that there are no
86
C implicit vector dependencies. Compiler directives for the
87
C Alliant FX/Fortran and CRI CFT/CFT77 compilers are supplied
88
C with the standard SLAP distribution.
92
C***ROUTINES CALLED (NONE)
93
C***REVISION HISTORY (YYMMDD)
95
C 881213 Previous REVISION DATE
96
C 890915 Made changes requested at July 1989 CML Meeting. (MKS)
97
C 890922 Numerous changes to prologue to make closer to SLATEC
99
C 890929 Numerous changes to reduce SP/DP differences. (FNF)
100
C 910411 Prologue converted to Version 4.0 format. (BAB)
101
C 920511 Added complete declaration section. (WRB)
102
C 921113 Corrected C***CATEGORY line. (FNF)
103
C 930701 Updated CATEGORY section. (FNF, WRB)
104
C***END PROLOGUE SSLI2
105
C .. Scalar Arguments ..
107
C .. Array Arguments ..
108
REAL B(N), EL(NEL), X(N)
109
INTEGER IEL(NEL), JEL(NEL)
110
C .. Local Scalars ..
111
INTEGER I, ICOL, J, JBGN, JEND
112
C***FIRST EXECUTABLE STATEMENT SSLI2
114
C Initialize the solution by copying the right hands side
123
X(ICOL) = X(ICOL)/EL(JEL(ICOL))
125
JEND = JEL(ICOL+1) - 1
126
IF( JBGN.LE.JEND ) THEN
127
CLLL. OPTION ASSERT (NOHAZARD)
132
X(IEL(J)) = X(IEL(J)) - EL(J)*X(ICOL)
138
C------------- LAST LINE OF SSLI2 FOLLOWS ----------------------------