1 SUBROUTINE ZSBMVF(UPLO, N, K, ALPHA, A, LDA, X, INCX, BETA, Y,
4 * -- LAPACK auxiliary routine (version 3.1) --
5 * Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
8 * .. Scalar Arguments ..
10 INTEGER INCX, INCY, K, LDA, N
11 COMPLEX*16 ALPHA, BETA
13 * .. Array Arguments ..
14 COMPLEX*16 A( LDA, * ), X( * ), Y( * )
20 * ZSBMV performs the matrix-vector operation
22 * y := alpha*A*x + beta*y,
24 * where alpha and beta are scalars, x and y are n element vectors and
25 * A is an n by n symmetric band matrix, with k super-diagonals.
31 * On entry, UPLO specifies whether the upper or lower
32 * triangular part of the band matrix A is being supplied as
35 * UPLO = 'U' or 'u' The upper triangular part of A is
38 * UPLO = 'L' or 'l' The lower triangular part of A is
44 * On entry, N specifies the order of the matrix A.
45 * N must be at least zero.
49 * On entry, K specifies the number of super-diagonals of the
50 * matrix A. K must satisfy 0 .le. K.
54 * On entry, ALPHA specifies the scalar alpha.
57 * A - COMPLEX*16 array, dimension( LDA, N )
58 * Before entry with UPLO = 'U' or 'u', the leading ( k + 1 )
59 * by n part of the array A must contain the upper triangular
60 * band part of the symmetric matrix, supplied column by
61 * column, with the leading diagonal of the matrix in row
62 * ( k + 1 ) of the array, the first super-diagonal starting at
63 * position 2 in row k, and so on. The top left k by k triangle
64 * of the array A is not referenced.
65 * The following program segment will transfer the upper
66 * triangular part of a symmetric band matrix from conventional
67 * full matrix storage to band storage:
71 * DO 10, I = MAX( 1, J - K ), J
72 * A( M + I, J ) = matrix( I, J )
76 * Before entry with UPLO = 'L' or 'l', the leading ( k + 1 )
77 * by n part of the array A must contain the lower triangular
78 * band part of the symmetric matrix, supplied column by
79 * column, with the leading diagonal of the matrix in row 1 of
80 * the array, the first sub-diagonal starting at position 1 in
81 * row 2, and so on. The bottom right k by k triangle of the
82 * array A is not referenced.
83 * The following program segment will transfer the lower
84 * triangular part of a symmetric band matrix from conventional
85 * full matrix storage to band storage:
89 * DO 10, I = J, MIN( N, J + K )
90 * A( M + I, J ) = matrix( I, J )
97 * On entry, LDA specifies the first dimension of A as declared
98 * in the calling (sub) program. LDA must be at least
102 * X - COMPLEX*16 array, dimension at least
103 * ( 1 + ( N - 1 )*abs( INCX ) ).
104 * Before entry, the incremented array X must contain the
109 * On entry, INCX specifies the increment for the elements of
110 * X. INCX must not be zero.
114 * On entry, BETA specifies the scalar beta.
117 * Y - COMPLEX*16 array, dimension at least
118 * ( 1 + ( N - 1 )*abs( INCY ) ).
119 * Before entry, the incremented array Y must contain the
120 * vector y. On exit, Y is overwritten by the updated vector y.
123 * On entry, INCY specifies the increment for the elements of
124 * Y. INCY must not be zero.
127 * =====================================================================
131 PARAMETER ( ONE = ( 1.0D+0, 0.0D+0 ) )
133 PARAMETER ( ZERO = ( 0.0D+0, 0.0D+0 ) )
135 * .. Local Scalars ..
136 INTEGER I, INFO, IX, IY, J, JX, JY, KPLUS1, KX, KY, L
137 COMPLEX*16 TEMP1, TEMP2
139 * .. External Functions ..
143 * .. External Subroutines ..
146 * .. Intrinsic Functions ..
149 * .. Executable Statements ..
151 * Test the input parameters.
154 IF( .NOT.LSAME( UPLO, 'U' ) .AND. .NOT.LSAME( UPLO, 'L' ) ) THEN
156 ELSE IF( N.LT.0 ) THEN
158 ELSE IF( K.LT.0 ) THEN
160 ELSE IF( LDA.LT.( K+1 ) ) THEN
162 ELSE IF( INCX.EQ.0 ) THEN
164 ELSE IF( INCY.EQ.0 ) THEN
168 CALL XERBLA( 'ZSBMV ', INFO )
172 * Quick return if possible.
174 IF( ( N.EQ.0 ) .OR. ( ( ALPHA.EQ.ZERO ) .AND. ( BETA.EQ.ONE ) ) )
177 * Set up the start points in X and Y.
182 KX = 1 - ( N-1 )*INCX
187 KY = 1 - ( N-1 )*INCY
190 * Start the operations. In this version the elements of the array A
191 * are accessed sequentially with one pass through A.
193 * First form y := beta*y.
195 IF( BETA.NE.ONE ) THEN
197 IF( BETA.EQ.ZERO ) THEN
208 IF( BETA.EQ.ZERO ) THEN
215 Y( IY ) = BETA*Y( IY )
223 IF( LSAME( UPLO, 'U' ) ) THEN
225 * Form y when upper triangle of A is stored.
228 IF( ( INCX.EQ.1 ) .AND. ( INCY.EQ.1 ) ) THEN
233 DO 50 I = MAX( 1, J-K ), J - 1
234 Y( I ) = Y( I ) + TEMP1*A( L+I, J )
235 TEMP2 = TEMP2 + A( L+I, J )*X( I )
237 Y( J ) = Y( J ) + TEMP1*A( KPLUS1, J ) + ALPHA*TEMP2
243 TEMP1 = ALPHA*X( JX )
248 DO 70 I = MAX( 1, J-K ), J - 1
249 Y( IY ) = Y( IY ) + TEMP1*A( L+I, J )
250 TEMP2 = TEMP2 + A( L+I, J )*X( IX )
254 Y( JY ) = Y( JY ) + TEMP1*A( KPLUS1, J ) + ALPHA*TEMP2
265 * Form y when lower triangle of A is stored.
267 IF( ( INCX.EQ.1 ) .AND. ( INCY.EQ.1 ) ) THEN
271 Y( J ) = Y( J ) + TEMP1*A( 1, J )
273 DO 90 I = J + 1, MIN( N, J+K )
274 Y( I ) = Y( I ) + TEMP1*A( L+I, J )
275 TEMP2 = TEMP2 + A( L+I, J )*X( I )
277 Y( J ) = Y( J ) + ALPHA*TEMP2
283 TEMP1 = ALPHA*X( JX )
285 Y( JY ) = Y( JY ) + TEMP1*A( 1, J )
289 DO 110 I = J + 1, MIN( N, J+K )
292 Y( IY ) = Y( IY ) + TEMP1*A( L+I, J )
293 TEMP2 = TEMP2 + A( L+I, J )*X( IX )
295 Y( JY ) = Y( JY ) + ALPHA*TEMP2