LAPACK  3.6.1
LAPACK: Linear Algebra PACKage
subroutine slaptm ( integer  N,
integer  NRHS,
real  ALPHA,
real, dimension( * )  D,
real, dimension( * )  E,
real, dimension( ldx, * )  X,
integer  LDX,
real  BETA,
real, dimension( ldb, * )  B,
integer  LDB 
)

SLAPTM

Purpose:
 SLAPTM multiplies an N by NRHS matrix X by a symmetric tridiagonal
 matrix A and stores the result in a matrix B.  The operation has the
 form

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

 where alpha may be either 1. or -1. and beta may be 0., 1., or -1.
Parameters
[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 REAL
          The scalar alpha.  ALPHA must be 1. or -1.; otherwise,
          it is assumed to be 0.
[in]D
          D is REAL array, dimension (N)
          The n diagonal elements of the tridiagonal matrix A.
[in]E
          E is REAL array, dimension (N-1)
          The (n-1) subdiagonal or superdiagonal elements of A.
[in]X
          X is REAL 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 REAL
          The scalar beta.  BETA must be 0., 1., or -1.; otherwise,
          it is assumed to be 1.
[in,out]B
          B is REAL 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
November 2011

Definition at line 118 of file slaptm.f.

118 *
119 * -- LAPACK test routine (version 3.4.0) --
120 * -- LAPACK is a software package provided by Univ. of Tennessee, --
121 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
122 * November 2011
123 *
124 * .. Scalar Arguments ..
125  INTEGER ldb, ldx, n, nrhs
126  REAL alpha, beta
127 * ..
128 * .. Array Arguments ..
129  REAL b( ldb, * ), d( * ), e( * ), x( ldx, * )
130 * ..
131 *
132 * =====================================================================
133 *
134 * .. Parameters ..
135  REAL one, zero
136  parameter ( one = 1.0e+0, zero = 0.0e+0 )
137 * ..
138 * .. Local Scalars ..
139  INTEGER i, j
140 * ..
141 * .. Executable Statements ..
142 *
143  IF( n.EQ.0 )
144  $ RETURN
145 *
146 * Multiply B by BETA if BETA.NE.1.
147 *
148  IF( beta.EQ.zero ) THEN
149  DO 20 j = 1, nrhs
150  DO 10 i = 1, n
151  b( i, j ) = zero
152  10 CONTINUE
153  20 CONTINUE
154  ELSE IF( beta.EQ.-one ) THEN
155  DO 40 j = 1, nrhs
156  DO 30 i = 1, n
157  b( i, j ) = -b( i, j )
158  30 CONTINUE
159  40 CONTINUE
160  END IF
161 *
162  IF( alpha.EQ.one ) THEN
163 *
164 * Compute B := B + A*X
165 *
166  DO 60 j = 1, nrhs
167  IF( n.EQ.1 ) THEN
168  b( 1, j ) = b( 1, j ) + d( 1 )*x( 1, j )
169  ELSE
170  b( 1, j ) = b( 1, j ) + d( 1 )*x( 1, j ) +
171  $ e( 1 )*x( 2, j )
172  b( n, j ) = b( n, j ) + e( n-1 )*x( n-1, j ) +
173  $ d( n )*x( n, j )
174  DO 50 i = 2, n - 1
175  b( i, j ) = b( i, j ) + e( i-1 )*x( i-1, j ) +
176  $ d( i )*x( i, j ) + e( i )*x( i+1, j )
177  50 CONTINUE
178  END IF
179  60 CONTINUE
180  ELSE IF( alpha.EQ.-one ) THEN
181 *
182 * Compute B := B - A*X
183 *
184  DO 80 j = 1, nrhs
185  IF( n.EQ.1 ) THEN
186  b( 1, j ) = b( 1, j ) - d( 1 )*x( 1, j )
187  ELSE
188  b( 1, j ) = b( 1, j ) - d( 1 )*x( 1, j ) -
189  $ e( 1 )*x( 2, j )
190  b( n, j ) = b( n, j ) - e( n-1 )*x( n-1, j ) -
191  $ d( n )*x( n, j )
192  DO 70 i = 2, n - 1
193  b( i, j ) = b( i, j ) - e( i-1 )*x( i-1, j ) -
194  $ d( i )*x( i, j ) - e( i )*x( i+1, j )
195  70 CONTINUE
196  END IF
197  80 CONTINUE
198  END IF
199  RETURN
200 *
201 * End of SLAPTM
202 *

Here is the caller graph for this function: