LAPACK  3.6.1 LAPACK: Linear Algebra PACKage
zlagtm.f
Go to the documentation of this file.
1 *> \brief \b ZLAGTM performs a matrix-matrix product of the form C = αAB+βC, where A is a tridiagonal matrix, B and C are rectangular matrices, and α and β are scalars, which may be 0, 1, or -1.
2 *
3 * =========== DOCUMENTATION ===========
4 *
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
7 *
8 *> \htmlonly
10 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/zlagtm.f">
11 *> [TGZ]</a>
12 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/zlagtm.f">
13 *> [ZIP]</a>
14 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zlagtm.f">
15 *> [TXT]</a>
16 *> \endhtmlonly
17 *
18 * Definition:
19 * ===========
20 *
21 * SUBROUTINE ZLAGTM( TRANS, N, NRHS, ALPHA, DL, D, DU, X, LDX, BETA,
22 * B, LDB )
23 *
24 * .. Scalar Arguments ..
25 * CHARACTER TRANS
26 * INTEGER LDB, LDX, N, NRHS
27 * DOUBLE PRECISION ALPHA, BETA
28 * ..
29 * .. Array Arguments ..
30 * COMPLEX*16 B( LDB, * ), D( * ), DL( * ), DU( * ),
31 * \$ X( LDX, * )
32 * ..
33 *
34 *
35 *> \par Purpose:
36 * =============
37 *>
38 *> \verbatim
39 *>
40 *> ZLAGTM performs a matrix-vector product of the form
41 *>
42 *> B := alpha * A * X + beta * B
43 *>
44 *> where A is a tridiagonal matrix of order N, B and X are N by NRHS
45 *> matrices, and alpha and beta are real scalars, each of which may be
46 *> 0., 1., or -1.
47 *> \endverbatim
48 *
49 * Arguments:
50 * ==========
51 *
52 *> \param[in] TRANS
53 *> \verbatim
54 *> TRANS is CHARACTER*1
55 *> Specifies the operation applied to A.
56 *> = 'N': No transpose, B := alpha * A * X + beta * B
57 *> = 'T': Transpose, B := alpha * A**T * X + beta * B
58 *> = 'C': Conjugate transpose, B := alpha * A**H * X + beta * B
59 *> \endverbatim
60 *>
61 *> \param[in] N
62 *> \verbatim
63 *> N is INTEGER
64 *> The order of the matrix A. N >= 0.
65 *> \endverbatim
66 *>
67 *> \param[in] NRHS
68 *> \verbatim
69 *> NRHS is INTEGER
70 *> The number of right hand sides, i.e., the number of columns
71 *> of the matrices X and B.
72 *> \endverbatim
73 *>
74 *> \param[in] ALPHA
75 *> \verbatim
76 *> ALPHA is DOUBLE PRECISION
77 *> The scalar alpha. ALPHA must be 0., 1., or -1.; otherwise,
78 *> it is assumed to be 0.
79 *> \endverbatim
80 *>
81 *> \param[in] DL
82 *> \verbatim
83 *> DL is COMPLEX*16 array, dimension (N-1)
84 *> The (n-1) sub-diagonal elements of T.
85 *> \endverbatim
86 *>
87 *> \param[in] D
88 *> \verbatim
89 *> D is COMPLEX*16 array, dimension (N)
90 *> The diagonal elements of T.
91 *> \endverbatim
92 *>
93 *> \param[in] DU
94 *> \verbatim
95 *> DU is COMPLEX*16 array, dimension (N-1)
96 *> The (n-1) super-diagonal elements of T.
97 *> \endverbatim
98 *>
99 *> \param[in] X
100 *> \verbatim
101 *> X is COMPLEX*16 array, dimension (LDX,NRHS)
102 *> The N by NRHS matrix X.
103 *> \endverbatim
104 *>
105 *> \param[in] LDX
106 *> \verbatim
107 *> LDX is INTEGER
108 *> The leading dimension of the array X. LDX >= max(N,1).
109 *> \endverbatim
110 *>
111 *> \param[in] BETA
112 *> \verbatim
113 *> BETA is DOUBLE PRECISION
114 *> The scalar beta. BETA must be 0., 1., or -1.; otherwise,
115 *> it is assumed to be 1.
116 *> \endverbatim
117 *>
118 *> \param[in,out] B
119 *> \verbatim
120 *> B is COMPLEX*16 array, dimension (LDB,NRHS)
121 *> On entry, the N by NRHS matrix B.
122 *> On exit, B is overwritten by the matrix expression
123 *> B := alpha * A * X + beta * B.
124 *> \endverbatim
125 *>
126 *> \param[in] LDB
127 *> \verbatim
128 *> LDB is INTEGER
129 *> The leading dimension of the array B. LDB >= max(N,1).
130 *> \endverbatim
131 *
132 * Authors:
133 * ========
134 *
135 *> \author Univ. of Tennessee
136 *> \author Univ. of California Berkeley
137 *> \author Univ. of Colorado Denver
138 *> \author NAG Ltd.
139 *
140 *> \date September 2012
141 *
142 *> \ingroup complex16OTHERauxiliary
143 *
144 * =====================================================================
145  SUBROUTINE zlagtm( TRANS, N, NRHS, ALPHA, DL, D, DU, X, LDX, BETA,
146  \$ b, ldb )
147 *
148 * -- LAPACK auxiliary routine (version 3.4.2) --
149 * -- LAPACK is a software package provided by Univ. of Tennessee, --
150 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
151 * September 2012
152 *
153 * .. Scalar Arguments ..
154  CHARACTER TRANS
155  INTEGER LDB, LDX, N, NRHS
156  DOUBLE PRECISION ALPHA, BETA
157 * ..
158 * .. Array Arguments ..
159  COMPLEX*16 B( ldb, * ), D( * ), DL( * ), DU( * ),
160  \$ x( ldx, * )
161 * ..
162 *
163 * =====================================================================
164 *
165 * .. Parameters ..
166  DOUBLE PRECISION ONE, ZERO
167  parameter ( one = 1.0d+0, zero = 0.0d+0 )
168 * ..
169 * .. Local Scalars ..
170  INTEGER I, J
171 * ..
172 * .. External Functions ..
173  LOGICAL LSAME
174  EXTERNAL lsame
175 * ..
176 * .. Intrinsic Functions ..
177  INTRINSIC dconjg
178 * ..
179 * .. Executable Statements ..
180 *
181  IF( n.EQ.0 )
182  \$ RETURN
183 *
184 * Multiply B by BETA if BETA.NE.1.
185 *
186  IF( beta.EQ.zero ) THEN
187  DO 20 j = 1, nrhs
188  DO 10 i = 1, n
189  b( i, j ) = zero
190  10 CONTINUE
191  20 CONTINUE
192  ELSE IF( beta.EQ.-one ) THEN
193  DO 40 j = 1, nrhs
194  DO 30 i = 1, n
195  b( i, j ) = -b( i, j )
196  30 CONTINUE
197  40 CONTINUE
198  END IF
199 *
200  IF( alpha.EQ.one ) THEN
201  IF( lsame( trans, 'N' ) ) THEN
202 *
203 * Compute B := B + A*X
204 *
205  DO 60 j = 1, nrhs
206  IF( n.EQ.1 ) THEN
207  b( 1, j ) = b( 1, j ) + d( 1 )*x( 1, j )
208  ELSE
209  b( 1, j ) = b( 1, j ) + d( 1 )*x( 1, j ) +
210  \$ du( 1 )*x( 2, j )
211  b( n, j ) = b( n, j ) + dl( n-1 )*x( n-1, j ) +
212  \$ d( n )*x( n, j )
213  DO 50 i = 2, n - 1
214  b( i, j ) = b( i, j ) + dl( i-1 )*x( i-1, j ) +
215  \$ d( i )*x( i, j ) + du( i )*x( i+1, j )
216  50 CONTINUE
217  END IF
218  60 CONTINUE
219  ELSE IF( lsame( trans, 'T' ) ) THEN
220 *
221 * Compute B := B + A**T * X
222 *
223  DO 80 j = 1, nrhs
224  IF( n.EQ.1 ) THEN
225  b( 1, j ) = b( 1, j ) + d( 1 )*x( 1, j )
226  ELSE
227  b( 1, j ) = b( 1, j ) + d( 1 )*x( 1, j ) +
228  \$ dl( 1 )*x( 2, j )
229  b( n, j ) = b( n, j ) + du( n-1 )*x( n-1, j ) +
230  \$ d( n )*x( n, j )
231  DO 70 i = 2, n - 1
232  b( i, j ) = b( i, j ) + du( i-1 )*x( i-1, j ) +
233  \$ d( i )*x( i, j ) + dl( i )*x( i+1, j )
234  70 CONTINUE
235  END IF
236  80 CONTINUE
237  ELSE IF( lsame( trans, 'C' ) ) THEN
238 *
239 * Compute B := B + A**H * X
240 *
241  DO 100 j = 1, nrhs
242  IF( n.EQ.1 ) THEN
243  b( 1, j ) = b( 1, j ) + dconjg( d( 1 ) )*x( 1, j )
244  ELSE
245  b( 1, j ) = b( 1, j ) + dconjg( d( 1 ) )*x( 1, j ) +
246  \$ dconjg( dl( 1 ) )*x( 2, j )
247  b( n, j ) = b( n, j ) + dconjg( du( n-1 ) )*
248  \$ x( n-1, j ) + dconjg( d( n ) )*x( n, j )
249  DO 90 i = 2, n - 1
250  b( i, j ) = b( i, j ) + dconjg( du( i-1 ) )*
251  \$ x( i-1, j ) + dconjg( d( i ) )*
252  \$ x( i, j ) + dconjg( dl( i ) )*
253  \$ x( i+1, j )
254  90 CONTINUE
255  END IF
256  100 CONTINUE
257  END IF
258  ELSE IF( alpha.EQ.-one ) THEN
259  IF( lsame( trans, 'N' ) ) THEN
260 *
261 * Compute B := B - A*X
262 *
263  DO 120 j = 1, nrhs
264  IF( n.EQ.1 ) THEN
265  b( 1, j ) = b( 1, j ) - d( 1 )*x( 1, j )
266  ELSE
267  b( 1, j ) = b( 1, j ) - d( 1 )*x( 1, j ) -
268  \$ du( 1 )*x( 2, j )
269  b( n, j ) = b( n, j ) - dl( n-1 )*x( n-1, j ) -
270  \$ d( n )*x( n, j )
271  DO 110 i = 2, n - 1
272  b( i, j ) = b( i, j ) - dl( i-1 )*x( i-1, j ) -
273  \$ d( i )*x( i, j ) - du( i )*x( i+1, j )
274  110 CONTINUE
275  END IF
276  120 CONTINUE
277  ELSE IF( lsame( trans, 'T' ) ) THEN
278 *
279 * Compute B := B - A**T *X
280 *
281  DO 140 j = 1, nrhs
282  IF( n.EQ.1 ) THEN
283  b( 1, j ) = b( 1, j ) - d( 1 )*x( 1, j )
284  ELSE
285  b( 1, j ) = b( 1, j ) - d( 1 )*x( 1, j ) -
286  \$ dl( 1 )*x( 2, j )
287  b( n, j ) = b( n, j ) - du( n-1 )*x( n-1, j ) -
288  \$ d( n )*x( n, j )
289  DO 130 i = 2, n - 1
290  b( i, j ) = b( i, j ) - du( i-1 )*x( i-1, j ) -
291  \$ d( i )*x( i, j ) - dl( i )*x( i+1, j )
292  130 CONTINUE
293  END IF
294  140 CONTINUE
295  ELSE IF( lsame( trans, 'C' ) ) THEN
296 *
297 * Compute B := B - A**H *X
298 *
299  DO 160 j = 1, nrhs
300  IF( n.EQ.1 ) THEN
301  b( 1, j ) = b( 1, j ) - dconjg( d( 1 ) )*x( 1, j )
302  ELSE
303  b( 1, j ) = b( 1, j ) - dconjg( d( 1 ) )*x( 1, j ) -
304  \$ dconjg( dl( 1 ) )*x( 2, j )
305  b( n, j ) = b( n, j ) - dconjg( du( n-1 ) )*
306  \$ x( n-1, j ) - dconjg( d( n ) )*x( n, j )
307  DO 150 i = 2, n - 1
308  b( i, j ) = b( i, j ) - dconjg( du( i-1 ) )*
309  \$ x( i-1, j ) - dconjg( d( i ) )*
310  \$ x( i, j ) - dconjg( dl( i ) )*
311  \$ x( i+1, j )
312  150 CONTINUE
313  END IF
314  160 CONTINUE
315  END IF
316  END IF
317  RETURN
318 *
319 * End of ZLAGTM
320 *
321  END
subroutine zlagtm(TRANS, N, NRHS, ALPHA, DL, D, DU, X, LDX, BETA, B, LDB)
ZLAGTM performs a matrix-matrix product of the form C = αAB+βC, where A is a tridiagonal matrix...
Definition: zlagtm.f:147