LAPACK  3.6.1
LAPACK: Linear Algebra PACKage
subroutine zptts2 ( integer  IUPLO,
integer  N,
integer  NRHS,
double precision, dimension( * )  D,
complex*16, dimension( * )  E,
complex*16, dimension( ldb, * )  B,
integer  LDB 
)

ZPTTS2 solves a tridiagonal system of the form AX=B using the L D LH factorization computed by spttrf.

Download ZPTTS2 + dependencies [TGZ] [ZIP] [TXT]

Purpose:
 ZPTTS2 solves a tridiagonal system of the form
    A * X = B
 using the factorization A = U**H *D*U or A = L*D*L**H computed by ZPTTRF.
 D is a diagonal matrix specified in the vector D, U (or L) is a unit
 bidiagonal matrix whose superdiagonal (subdiagonal) is specified in
 the vector E, and X and B are N by NRHS matrices.
Parameters
[in]IUPLO
          IUPLO is INTEGER
          Specifies the form of the factorization and whether the
          vector E is the superdiagonal of the upper bidiagonal factor
          U or the subdiagonal of the lower bidiagonal factor L.
          = 1:  A = U**H *D*U, E is the superdiagonal of U
          = 0:  A = L*D*L**H, E is the subdiagonal of L
[in]N
          N is INTEGER
          The order of the tridiagonal matrix A.  N >= 0.
[in]NRHS
          NRHS is INTEGER
          The number of right hand sides, i.e., the number of columns
          of the matrix B.  NRHS >= 0.
[in]D
          D is DOUBLE PRECISION array, dimension (N)
          The n diagonal elements of the diagonal matrix D from the
          factorization A = U**H *D*U or A = L*D*L**H.
[in]E
          E is COMPLEX*16 array, dimension (N-1)
          If IUPLO = 1, the (n-1) superdiagonal elements of the unit
          bidiagonal factor U from the factorization A = U**H*D*U.
          If IUPLO = 0, the (n-1) subdiagonal elements of the unit
          bidiagonal factor L from the factorization A = L*D*L**H.
[in,out]B
          B is COMPLEX*16 array, dimension (LDB,NRHS)
          On entry, the right hand side vectors B for the system of
          linear equations.
          On exit, the solution vectors, X.
[in]LDB
          LDB is INTEGER
          The leading dimension of the array B.  LDB >= max(1,N).
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Date
June 2016

Definition at line 115 of file zptts2.f.

115 *
116 * -- LAPACK computational routine (version 3.6.1) --
117 * -- LAPACK is a software package provided by Univ. of Tennessee, --
118 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
119 * June 2016
120 *
121 * .. Scalar Arguments ..
122  INTEGER iuplo, ldb, n, nrhs
123 * ..
124 * .. Array Arguments ..
125  DOUBLE PRECISION d( * )
126  COMPLEX*16 b( ldb, * ), e( * )
127 * ..
128 *
129 * =====================================================================
130 *
131 * .. Local Scalars ..
132  INTEGER i, j
133 * ..
134 * .. External Subroutines ..
135  EXTERNAL zdscal
136 * ..
137 * .. Intrinsic Functions ..
138  INTRINSIC dconjg
139 * ..
140 * .. Executable Statements ..
141 *
142 * Quick return if possible
143 *
144  IF( n.LE.1 ) THEN
145  IF( n.EQ.1 )
146  $ CALL zdscal( nrhs, 1.d0 / d( 1 ), b, ldb )
147  RETURN
148  END IF
149 *
150  IF( iuplo.EQ.1 ) THEN
151 *
152 * Solve A * X = B using the factorization A = U**H *D*U,
153 * overwriting each right hand side vector with its solution.
154 *
155  IF( nrhs.LE.2 ) THEN
156  j = 1
157  10 CONTINUE
158 *
159 * Solve U**H * x = b.
160 *
161  DO 20 i = 2, n
162  b( i, j ) = b( i, j ) - b( i-1, j )*dconjg( e( i-1 ) )
163  20 CONTINUE
164 *
165 * Solve D * U * x = b.
166 *
167  DO 30 i = 1, n
168  b( i, j ) = b( i, j ) / d( i )
169  30 CONTINUE
170  DO 40 i = n - 1, 1, -1
171  b( i, j ) = b( i, j ) - b( i+1, j )*e( i )
172  40 CONTINUE
173  IF( j.LT.nrhs ) THEN
174  j = j + 1
175  GO TO 10
176  END IF
177  ELSE
178  DO 70 j = 1, nrhs
179 *
180 * Solve U**H * x = b.
181 *
182  DO 50 i = 2, n
183  b( i, j ) = b( i, j ) - b( i-1, j )*dconjg( e( i-1 ) )
184  50 CONTINUE
185 *
186 * Solve D * U * x = b.
187 *
188  b( n, j ) = b( n, j ) / d( n )
189  DO 60 i = n - 1, 1, -1
190  b( i, j ) = b( i, j ) / d( i ) - b( i+1, j )*e( i )
191  60 CONTINUE
192  70 CONTINUE
193  END IF
194  ELSE
195 *
196 * Solve A * X = B using the factorization A = L*D*L**H,
197 * overwriting each right hand side vector with its solution.
198 *
199  IF( nrhs.LE.2 ) THEN
200  j = 1
201  80 CONTINUE
202 *
203 * Solve L * x = b.
204 *
205  DO 90 i = 2, n
206  b( i, j ) = b( i, j ) - b( i-1, j )*e( i-1 )
207  90 CONTINUE
208 *
209 * Solve D * L**H * x = b.
210 *
211  DO 100 i = 1, n
212  b( i, j ) = b( i, j ) / d( i )
213  100 CONTINUE
214  DO 110 i = n - 1, 1, -1
215  b( i, j ) = b( i, j ) - b( i+1, j )*dconjg( e( i ) )
216  110 CONTINUE
217  IF( j.LT.nrhs ) THEN
218  j = j + 1
219  GO TO 80
220  END IF
221  ELSE
222  DO 140 j = 1, nrhs
223 *
224 * Solve L * x = b.
225 *
226  DO 120 i = 2, n
227  b( i, j ) = b( i, j ) - b( i-1, j )*e( i-1 )
228  120 CONTINUE
229 *
230 * Solve D * L**H * x = b.
231 *
232  b( n, j ) = b( n, j ) / d( n )
233  DO 130 i = n - 1, 1, -1
234  b( i, j ) = b( i, j ) / d( i ) -
235  $ b( i+1, j )*dconjg( e( i ) )
236  130 CONTINUE
237  140 CONTINUE
238  END IF
239  END IF
240 *
241  RETURN
242 *
243 * End of ZPTTS2
244 *
subroutine zdscal(N, DA, ZX, INCX)
ZDSCAL
Definition: zdscal.f:54

Here is the call graph for this function:

Here is the caller graph for this function: