~ubuntu-branches/ubuntu/wily/julia/wily

« back to all changes in this revision

Viewing changes to deps/openlibm/slatec/ssli2.f

  • Committer: Package Import Robot
  • Author(s): Sébastien Villemot
  • Date: 2013-01-16 12:29:42 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20130116122942-x86e42akjq31repw
Tags: 0.0.0+20130107.gitd9656f41-1
* New upstream snashot
* No longer try to rebuild helpdb.jl.
   + debian/rules: remove helpdb.jl from build-arch rule
   + debian/control: move back python-sphinx to Build-Depends-Indep
* debian/copyright: reflect upstream changes
* Add Build-Conflicts on libatlas3-base (makes linalg tests fail)
* debian/rules: replace obsolete USE_DEBIAN makeflag by a list of
  USE_SYSTEM_* flags
* debian/rules: on non-x86 systems, use libm instead of openlibm
* dpkg-buildflags.patch: remove patch, applied upstream
* Refreshed other patches

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
*DECK SSLI2
 
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)
 
8
C***CATEGORY  D2A3
 
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
 
14
C             PO BOX 808, L-60
 
15
C             Livermore, CA 94550 (510) 423-3141
 
16
C             seager@llnl.gov
 
17
C***DESCRIPTION
 
18
C
 
19
C *Usage:
 
20
C     INTEGER N, NEL, IEL(NEL), JEL(NEL)
 
21
C     REAL    B(N), X(N), EL(NEL)
 
22
C
 
23
C     CALL SSLI2( N, B, X, NEL, IEL, JEL, EL )
 
24
C
 
25
C *Arguments:
 
26
C N      :IN       Integer
 
27
C         Order of the Matrix.
 
28
C B      :IN       Real B(N).
 
29
C         Right hand side vector.
 
30
C X      :OUT      Real X(N).
 
31
C         Solution to Lx = b.
 
32
C NEL    :IN       Integer.
 
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
 
42
C         format.
 
43
C
 
44
C *Description:
 
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 ****
 
51
C
 
52
C       ==================== S L A P Row format ====================
 
53
C
 
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
 
69
C       matrix.
 
70
C
 
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):
 
73
C
 
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
 
79
C       | 0  0  0 44  0|
 
80
C       |51  0 53  0 55|
 
81
C
 
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.
 
89
C
 
90
C***SEE ALSO  SSLI
 
91
C***REFERENCES  (NONE)
 
92
C***ROUTINES CALLED  (NONE)
 
93
C***REVISION HISTORY  (YYMMDD)
 
94
C   871119  DATE WRITTEN
 
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
 
98
C           standard.  (FNF)
 
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 ..
 
106
      INTEGER N, NEL
 
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
 
113
C
 
114
C         Initialize the solution by copying the right hands side
 
115
C         into it.
 
116
C
 
117
      DO 10 I=1,N
 
118
         X(I) = B(I)
 
119
 10   CONTINUE
 
120
C
 
121
CVD$ NOCONCUR
 
122
      DO 30 ICOL = 1, N
 
123
         X(ICOL) = X(ICOL)/EL(JEL(ICOL))
 
124
         JBGN = JEL(ICOL) + 1
 
125
         JEND = JEL(ICOL+1) - 1
 
126
         IF( JBGN.LE.JEND ) THEN
 
127
CLLL. OPTION ASSERT (NOHAZARD)
 
128
CDIR$ IVDEP
 
129
CVD$ NOCONCUR
 
130
CVD$ NODEPCHK
 
131
            DO 20 J = JBGN, JEND
 
132
               X(IEL(J)) = X(IEL(J)) - EL(J)*X(ICOL)
 
133
 20         CONTINUE
 
134
         ENDIF
 
135
 30   CONTINUE
 
136
C
 
137
      RETURN
 
138
C------------- LAST LINE OF SSLI2 FOLLOWS ----------------------------
 
139
      END