OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
zpttrsv.f
Go to the documentation of this file.
1 SUBROUTINE zpttrsv( UPLO, TRANS, N, NRHS, D, E, B, LDB,
2 $ INFO )
3*
4* -- ScaLAPACK auxiliary routine (version 2.0) --
5* Univ. of Tennessee, Univ. of California Berkeley, Univ. of Colorado Denver
6*
7* Written by Andrew J. Cleary, University of Tennessee.
8* November, 1996.
9* Modified from ZPTTRS:
10* -- LAPACK routine (preliminary version) --
11* Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
12* Courant Institute, Argonne National Lab, and Rice University
13*
14* .. Scalar Arguments ..
15 CHARACTER UPLO, TRANS
16 INTEGER INFO, LDB, N, NRHS
17* ..
18* .. Array Arguments ..
19 DOUBLE PRECISION D( * )
20 COMPLEX*16 B( LDB, * ), E( * )
21* ..
22*
23* Purpose
24* =======
25*
26* ZPTTRSV solves one of the triangular systems
27* L * X = B, or L**H * X = B,
28* U * X = B, or U**H * X = B,
29* where L or U is the Cholesky factor of a Hermitian positive
30* definite tridiagonal matrix A such that
31* A = U**H*D*U or A = L*D*L**H (computed by ZPTTRF).
32*
33* Arguments
34* =========
35*
36* UPLO (input) CHARACTER*1
37* Specifies whether the superdiagonal or the subdiagonal
38* of the tridiagonal matrix A is stored and the form of the
39* factorization:
40* = 'U': E is the superdiagonal of U, and A = U'*D*U;
41* = 'L': E is the subdiagonal of L, and A = L*D*L'.
42* (The two forms are equivalent if A is real.)
43*
44* TRANS (input) CHARACTER
45* Specifies the form of the system of equations:
46* = 'N': L * X = B (No transpose)
47* = 'N': L * X = B (No transpose)
48* = 'C': U**H * X = B (Conjugate transpose)
49* = 'C': L**H * X = B (Conjugate transpose)
50*
51* N (input) INTEGER
52* The order of the tridiagonal matrix A. N >= 0.
53*
54* NRHS (input) INTEGER
55* The number of right hand sides, i.e., the number of columns
56* of the matrix B. NRHS >= 0.
57*
58* D (input) REAL array, dimension (N)
59* The n diagonal elements of the diagonal matrix D from the
60* factorization computed by ZPTTRF.
61*
62* E (input) COMPLEX array, dimension (N-1)
63* The (n-1) off-diagonal elements of the unit bidiagonal
64* factor U or L from the factorization computed by ZPTTRF
65* (see UPLO).
66*
67* B (input/output) COMPLEX array, dimension (LDB,NRHS)
68* On entry, the right hand side matrix B.
69* On exit, the solution matrix X.
70*
71* LDB (input) INTEGER
72* The leading dimension of the array B. LDB >= max(1,N).
73*
74* INFO (output) INTEGER
75* = 0: successful exit
76* < 0: if INFO = -i, the i-th argument had an illegal value
77*
78* =====================================================================
79*
80* .. Local Scalars ..
81 LOGICAL NOTRAN, UPPER
82 INTEGER I, J
83* ..
84* .. External Functions ..
85 LOGICAL LSAME
86 EXTERNAL lsame
87* ..
88* .. External Subroutines ..
89 EXTERNAL xerbla
90* ..
91* .. Intrinsic Functions ..
92 INTRINSIC dconjg, max
93* ..
94* .. Executable Statements ..
95*
96* Test the input arguments.
97*
98 info = 0
99 notran = lsame( trans, 'n' )
100 UPPER = LSAME( UPLO, 'u' )
101.NOT..AND..NOT. IF( UPPER LSAME( UPLO, 'l' ) ) THEN
102 INFO = -1
103.NOT..AND..NOT. ELSE IF( NOTRAN
104 $ LSAME( TRANS, 'c' ) ) THEN
105 INFO = -2
106.LT. ELSE IF( N0 ) THEN
107 INFO = -3
108.LT. ELSE IF( NRHS0 ) THEN
109 INFO = -4
110.LT. ELSE IF( LDBMAX( 1, N ) ) THEN
111 INFO = -8
112 END IF
113.NE. IF( INFO0 ) THEN
114 CALL XERBLA( 'zpttrs', -INFO )
115 RETURN
116 END IF
117*
118* Quick return if possible
119*
120.EQ. IF( N0 )
121 $ RETURN
122*
123 IF( UPPER ) THEN
124*
125.NOT. IF( NOTRAN ) THEN
126*
127 DO 30 J = 1, NRHS
128*
129* Solve U**T (or H) * x = b.
130*
131 DO 10 I = 2, N
132 B( I, J ) = B( I, J ) - B( I-1, J )*DCONJG( E( I-1 ) )
133 10 CONTINUE
134 30 CONTINUE
135*
136 ELSE
137*
138 DO 35 J = 1, NRHS
139*
140* Solve U * x = b.
141*
142 DO 20 I = N - 1, 1, -1
143 B( I, J ) = B( I, J ) - B( I+1, J )*E( I )
144 20 CONTINUE
145 35 CONTINUE
146 ENDIF
147*
148 ELSE
149*
150 IF( NOTRAN ) THEN
151*
152 DO 60 J = 1, NRHS
153*
154* Solve L * x = b.
155*
156 DO 40 I = 2, N
157 B( I, J ) = B( I, J ) - B( I-1, J )*E( I-1 )
158 40 CONTINUE
159 60 CONTINUE
160*
161 ELSE
162*
163 DO 65 J = 1, NRHS
164*
165* Solve L**H * x = b.
166*
167 DO 50 I = N - 1, 1, -1
168 B( I, J ) = B( I, J ) -
169 $ B( I+1, J )*DCONJG( E( I ) )
170 50 CONTINUE
171 65 CONTINUE
172 ENDIF
173*
174 END IF
175*
176 RETURN
177*
178* End of ZPTTRS
179*
180 END
subroutine xerbla(srname, info)
XERBLA
Definition xerbla.f:60
subroutine zpttrs(uplo, n, nrhs, d, e, b, ldb, info)
ZPTTRS
Definition zpttrs.f:121
#define max(a, b)
Definition macros.h:21
subroutine zpttrsv(uplo, trans, n, nrhs, d, e, b, ldb, info)
Definition zpttrsv.f:3