1 *> \brief \b DLAGTM 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.
3 * =========== DOCUMENTATION ===========
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
9 *> Download DLAGTM + dependencies
10 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/dlagtm.f">
12 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/dlagtm.f">
14 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dlagtm.f">
21 * SUBROUTINE DLAGTM( TRANS, N, NRHS, ALPHA, DL, D, DU, X, LDX, BETA,
24 * .. Scalar Arguments ..
26 * INTEGER LDB, LDX, N, NRHS
27 * DOUBLE PRECISION ALPHA, BETA
29 * .. Array Arguments ..
30 * DOUBLE PRECISION B( LDB, * ), D( * ), DL( * ), DU( * ),
40 *> DLAGTM performs a matrix-vector product of the form
42 *> B := alpha * A * X + beta * B
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
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'* X + beta * B
58 *> = 'C': Conjugate transpose = Transpose
64 *> The order of the matrix A. N >= 0.
70 *> The number of right hand sides, i.e., the number of columns
71 *> of the matrices X and B.
76 *> ALPHA is DOUBLE PRECISION
77 *> The scalar alpha. ALPHA must be 0., 1., or -1.; otherwise,
78 *> it is assumed to be 0.
83 *> DL is DOUBLE PRECISION array, dimension (N-1)
84 *> The (n-1) sub-diagonal elements of T.
89 *> D is DOUBLE PRECISION array, dimension (N)
90 *> The diagonal elements of T.
95 *> DU is DOUBLE PRECISION array, dimension (N-1)
96 *> The (n-1) super-diagonal elements of T.
101 *> X is DOUBLE PRECISION array, dimension (LDX,NRHS)
102 *> The N by NRHS matrix X.
108 *> The leading dimension of the array X. LDX >= max(N,1).
113 *> BETA is DOUBLE PRECISION
114 *> The scalar beta. BETA must be 0., 1., or -1.; otherwise,
115 *> it is assumed to be 1.
120 *> B is DOUBLE PRECISION 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.
129 *> The leading dimension of the array B. LDB >= max(N,1).
135 *> \author Univ. of Tennessee
136 *> \author Univ. of California Berkeley
137 *> \author Univ. of Colorado Denver
140 *> \date September 2012
142 *> \ingroup doubleOTHERauxiliary
144 * =====================================================================
145 SUBROUTINE DLAGTM( TRANS, N, NRHS, ALPHA, DL, D, DU, X, LDX, BETA,
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..--
153 * .. Scalar Arguments ..
155 INTEGER LDB, LDX, N, NRHS
156 DOUBLE PRECISION ALPHA, BETA
158 * .. Array Arguments ..
159 DOUBLE PRECISION B( LDB, * ), D( * ), DL( * ), DU( * ),
163 * =====================================================================
166 DOUBLE PRECISION ONE, ZERO
167 PARAMETER ( ONE = 1.0D+0, ZERO = 0.0D+0 )
169 * .. Local Scalars ..
172 * .. External Functions ..
176 * .. Executable Statements ..
181 * Multiply B by BETA if BETA.NE.1.
183 IF( BETA.EQ.ZERO ) THEN
189 ELSE IF( BETA.EQ.-ONE ) THEN
192 B( I, J ) = -B( I, J )
197 IF( ALPHA.EQ.ONE ) THEN
198 IF( LSAME( TRANS, 'N' ) ) THEN
200 * Compute B := B + A*X
204 B( 1, J ) = B( 1, J ) + D( 1 )*X( 1, J )
206 B( 1, J ) = B( 1, J ) + D( 1 )*X( 1, J ) +
208 B( N, J ) = B( N, J ) + DL( N-1 )*X( N-1, J ) +
211 B( I, J ) = B( I, J ) + DL( I-1 )*X( I-1, J ) +
212 $ D( I )*X( I, J ) + DU( I )*X( I+1, J )
218 * Compute B := B + A**T*X
222 B( 1, J ) = B( 1, J ) + D( 1 )*X( 1, J )
224 B( 1, J ) = B( 1, J ) + D( 1 )*X( 1, J ) +
226 B( N, J ) = B( N, J ) + DU( N-1 )*X( N-1, J ) +
229 B( I, J ) = B( I, J ) + DU( I-1 )*X( I-1, J ) +
230 $ D( I )*X( I, J ) + DL( I )*X( I+1, J )
235 ELSE IF( ALPHA.EQ.-ONE ) THEN
236 IF( LSAME( TRANS, 'N' ) ) THEN
238 * Compute B := B - A*X
242 B( 1, J ) = B( 1, J ) - D( 1 )*X( 1, J )
244 B( 1, J ) = B( 1, J ) - D( 1 )*X( 1, J ) -
246 B( N, J ) = B( N, J ) - DL( N-1 )*X( N-1, J ) -
249 B( I, J ) = B( I, J ) - DL( I-1 )*X( I-1, J ) -
250 $ D( I )*X( I, J ) - DU( I )*X( I+1, J )
256 * Compute B := B - A**T*X
260 B( 1, J ) = B( 1, J ) - D( 1 )*X( 1, J )
262 B( 1, J ) = B( 1, J ) - D( 1 )*X( 1, J ) -
264 B( N, J ) = B( N, J ) - DU( N-1 )*X( N-1, J ) -
267 B( I, J ) = B( I, J ) - DU( I-1 )*X( I-1, J ) -
268 $ D( I )*X( I, J ) - DL( I )*X( I+1, J )