LAPACK  3.8.0
LAPACK: Linear Algebra PACKage

◆ dlagtm()

subroutine dlagtm ( character  TRANS,
integer  N,
integer  NRHS,
double precision  ALPHA,
double precision, dimension( * )  DL,
double precision, dimension( * )  D,
double precision, dimension( * )  DU,
double precision, dimension( ldx, * )  X,
integer  LDX,
double precision  BETA,
double precision, dimension( ldb, * )  B,
integer  LDB 
)

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.

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

Purpose:
 DLAGTM performs a matrix-vector product of the form

    B := alpha * A * X + beta * B

 where A is a tridiagonal matrix of order N, B and X are N by NRHS
 matrices, and alpha and beta are real scalars, each of which may be
 0., 1., or -1.
Parameters
[in]TRANS
          TRANS is CHARACTER*1
          Specifies the operation applied to A.
          = 'N':  No transpose, B := alpha * A * X + beta * B
          = 'T':  Transpose,    B := alpha * A'* X + beta * B
          = 'C':  Conjugate transpose = Transpose
[in]N
          N is INTEGER
          The order of the matrix A.  N >= 0.
[in]NRHS
          NRHS is INTEGER
          The number of right hand sides, i.e., the number of columns
          of the matrices X and B.
[in]ALPHA
          ALPHA is DOUBLE PRECISION
          The scalar alpha.  ALPHA must be 0., 1., or -1.; otherwise,
          it is assumed to be 0.
[in]DL
          DL is DOUBLE PRECISION array, dimension (N-1)
          The (n-1) sub-diagonal elements of T.
[in]D
          D is DOUBLE PRECISION array, dimension (N)
          The diagonal elements of T.
[in]DU
          DU is DOUBLE PRECISION array, dimension (N-1)
          The (n-1) super-diagonal elements of T.
[in]X
          X is DOUBLE PRECISION array, dimension (LDX,NRHS)
          The N by NRHS matrix X.
[in]LDX
          LDX is INTEGER
          The leading dimension of the array X.  LDX >= max(N,1).
[in]BETA
          BETA is DOUBLE PRECISION
          The scalar beta.  BETA must be 0., 1., or -1.; otherwise,
          it is assumed to be 1.
[in,out]B
          B is DOUBLE PRECISION array, dimension (LDB,NRHS)
          On entry, the N by NRHS matrix B.
          On exit, B is overwritten by the matrix expression
          B := alpha * A * X + beta * B.
[in]LDB
          LDB is INTEGER
          The leading dimension of the array B.  LDB >= max(N,1).
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Date
December 2016

Definition at line 147 of file dlagtm.f.

147 *
148 * -- LAPACK auxiliary routine (version 3.7.0) --
149 * -- LAPACK is a software package provided by Univ. of Tennessee, --
150 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
151 * December 2016
152 *
153 * .. Scalar Arguments ..
154  CHARACTER trans
155  INTEGER ldb, ldx, n, nrhs
156  DOUBLE PRECISION alpha, beta
157 * ..
158 * .. Array Arguments ..
159  DOUBLE PRECISION 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 * .. Executable Statements ..
177 *
178  IF( n.EQ.0 )
179  $ RETURN
180 *
181 * Multiply B by BETA if BETA.NE.1.
182 *
183  IF( beta.EQ.zero ) THEN
184  DO 20 j = 1, nrhs
185  DO 10 i = 1, n
186  b( i, j ) = zero
187  10 CONTINUE
188  20 CONTINUE
189  ELSE IF( beta.EQ.-one ) THEN
190  DO 40 j = 1, nrhs
191  DO 30 i = 1, n
192  b( i, j ) = -b( i, j )
193  30 CONTINUE
194  40 CONTINUE
195  END IF
196 *
197  IF( alpha.EQ.one ) THEN
198  IF( lsame( trans, 'N' ) ) THEN
199 *
200 * Compute B := B + A*X
201 *
202  DO 60 j = 1, nrhs
203  IF( n.EQ.1 ) THEN
204  b( 1, j ) = b( 1, j ) + d( 1 )*x( 1, j )
205  ELSE
206  b( 1, j ) = b( 1, j ) + d( 1 )*x( 1, j ) +
207  $ du( 1 )*x( 2, j )
208  b( n, j ) = b( n, j ) + dl( n-1 )*x( n-1, j ) +
209  $ d( n )*x( n, j )
210  DO 50 i = 2, n - 1
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 )
213  50 CONTINUE
214  END IF
215  60 CONTINUE
216  ELSE
217 *
218 * Compute B := B + A**T*X
219 *
220  DO 80 j = 1, nrhs
221  IF( n.EQ.1 ) THEN
222  b( 1, j ) = b( 1, j ) + d( 1 )*x( 1, j )
223  ELSE
224  b( 1, j ) = b( 1, j ) + d( 1 )*x( 1, j ) +
225  $ dl( 1 )*x( 2, j )
226  b( n, j ) = b( n, j ) + du( n-1 )*x( n-1, j ) +
227  $ d( n )*x( n, j )
228  DO 70 i = 2, n - 1
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 )
231  70 CONTINUE
232  END IF
233  80 CONTINUE
234  END IF
235  ELSE IF( alpha.EQ.-one ) THEN
236  IF( lsame( trans, 'N' ) ) THEN
237 *
238 * Compute B := B - A*X
239 *
240  DO 100 j = 1, nrhs
241  IF( n.EQ.1 ) THEN
242  b( 1, j ) = b( 1, j ) - d( 1 )*x( 1, j )
243  ELSE
244  b( 1, j ) = b( 1, j ) - d( 1 )*x( 1, j ) -
245  $ du( 1 )*x( 2, j )
246  b( n, j ) = b( n, j ) - dl( n-1 )*x( n-1, j ) -
247  $ d( n )*x( n, j )
248  DO 90 i = 2, n - 1
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 )
251  90 CONTINUE
252  END IF
253  100 CONTINUE
254  ELSE
255 *
256 * Compute B := B - A**T*X
257 *
258  DO 120 j = 1, nrhs
259  IF( n.EQ.1 ) THEN
260  b( 1, j ) = b( 1, j ) - d( 1 )*x( 1, j )
261  ELSE
262  b( 1, j ) = b( 1, j ) - d( 1 )*x( 1, j ) -
263  $ dl( 1 )*x( 2, j )
264  b( n, j ) = b( n, j ) - du( n-1 )*x( n-1, j ) -
265  $ d( n )*x( n, j )
266  DO 110 i = 2, n - 1
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 )
269  110 CONTINUE
270  END IF
271  120 CONTINUE
272  END IF
273  END IF
274  RETURN
275 *
276 * End of DLAGTM
277 *
logical function lsame(CA, CB)
LSAME
Definition: lsame.f:55
Here is the caller graph for this function: