1 *> \brief \b ZSYMV computes a matrix-vector product for a complex symmetric matrix.
3 * =========== DOCUMENTATION ===========
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
9 *> Download ZSYMV + dependencies
10 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/zsymv.f">
12 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/zsymv.f">
14 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zsymv.f">
21 * SUBROUTINE ZSYMV( UPLO, N, ALPHA, A, LDA, X, INCX, BETA, Y, INCY )
23 * .. Scalar Arguments ..
25 * INTEGER INCX, INCY, LDA, N
26 * COMPLEX*16 ALPHA, BETA
28 * .. Array Arguments ..
29 * COMPLEX*16 A( LDA, * ), X( * ), Y( * )
38 *> ZSYMV performs the matrix-vector operation
40 *> y := alpha*A*x + beta*y,
42 *> where alpha and beta are scalars, x and y are n element vectors and
43 *> A is an n by n symmetric matrix.
51 *> UPLO is CHARACTER*1
52 *> On entry, UPLO specifies whether the upper or lower
53 *> triangular part of the array A is to be referenced as
56 *> UPLO = 'U' or 'u' Only the upper triangular part of A
57 *> is to be referenced.
59 *> UPLO = 'L' or 'l' Only the lower triangular part of A
60 *> is to be referenced.
68 *> On entry, N specifies the order of the matrix A.
69 *> N must be at least zero.
75 *> ALPHA is COMPLEX*16
76 *> On entry, ALPHA specifies the scalar alpha.
82 *> A is COMPLEX*16 array, dimension ( LDA, N )
83 *> Before entry, with UPLO = 'U' or 'u', the leading n by n
84 *> upper triangular part of the array A must contain the upper
85 *> triangular part of the symmetric matrix and the strictly
86 *> lower triangular part of A is not referenced.
87 *> Before entry, with UPLO = 'L' or 'l', the leading n by n
88 *> lower triangular part of the array A must contain the lower
89 *> triangular part of the symmetric matrix and the strictly
90 *> upper triangular part of A is not referenced.
97 *> On entry, LDA specifies the first dimension of A as declared
98 *> in the calling (sub) program. LDA must be at least
100 *> Unchanged on exit.
105 *> X is COMPLEX*16 array, dimension at least
106 *> ( 1 + ( N - 1 )*abs( INCX ) ).
107 *> Before entry, the incremented array X must contain the N-
109 *> Unchanged on exit.
115 *> On entry, INCX specifies the increment for the elements of
116 *> X. INCX must not be zero.
117 *> Unchanged on exit.
122 *> BETA is COMPLEX*16
123 *> On entry, BETA specifies the scalar beta. When BETA is
124 *> supplied as zero then Y need not be set on input.
125 *> Unchanged on exit.
130 *> Y is COMPLEX*16 array, dimension at least
131 *> ( 1 + ( N - 1 )*abs( INCY ) ).
132 *> Before entry, the incremented array Y must contain the n
133 *> element vector y. On exit, Y is overwritten by the updated
140 *> On entry, INCY specifies the increment for the elements of
141 *> Y. INCY must not be zero.
142 *> Unchanged on exit.
148 *> \author Univ. of Tennessee
149 *> \author Univ. of California Berkeley
150 *> \author Univ. of Colorado Denver
153 *> \date September 2012
155 *> \ingroup complex16SYauxiliary
157 * =====================================================================
158 SUBROUTINE ZSYMV( UPLO, N, ALPHA, A, LDA, X, INCX, BETA, Y, INCY )
160 * -- LAPACK auxiliary routine (version 3.4.2) --
161 * -- LAPACK is a software package provided by Univ. of Tennessee, --
162 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
165 * .. Scalar Arguments ..
167 INTEGER INCX, INCY, LDA, N
168 COMPLEX*16 ALPHA, BETA
170 * .. Array Arguments ..
171 COMPLEX*16 A( LDA, * ), X( * ), Y( * )
174 * =====================================================================
178 PARAMETER ( ONE = ( 1.0D+0, 0.0D+0 ) )
180 PARAMETER ( ZERO = ( 0.0D+0, 0.0D+0 ) )
182 * .. Local Scalars ..
183 INTEGER I, INFO, IX, IY, J, JX, JY, KX, KY
184 COMPLEX*16 TEMP1, TEMP2
186 * .. External Functions ..
190 * .. External Subroutines ..
193 * .. Intrinsic Functions ..
196 * .. Executable Statements ..
198 * Test the input parameters.
201 IF( .NOT.LSAME( UPLO, 'U' ) .AND. .NOT.LSAME( UPLO, 'L' ) ) THEN
203 ELSE IF( N.LT.0 ) THEN
205 ELSE IF( LDA.LT.MAX( 1, N ) ) THEN
207 ELSE IF( INCX.EQ.0 ) THEN
209 ELSE IF( INCY.EQ.0 ) THEN
213 CALL XERBLA( 'ZSYMV ', INFO )
217 * Quick return if possible.
219 IF( ( N.EQ.0 ) .OR. ( ( ALPHA.EQ.ZERO ) .AND. ( BETA.EQ.ONE ) ) )
222 * Set up the start points in X and Y.
227 KX = 1 - ( N-1 )*INCX
232 KY = 1 - ( N-1 )*INCY
235 * Start the operations. In this version the elements of A are
236 * accessed sequentially with one pass through the triangular part
239 * First form y := beta*y.
241 IF( BETA.NE.ONE ) THEN
243 IF( BETA.EQ.ZERO ) THEN
254 IF( BETA.EQ.ZERO ) THEN
261 Y( IY ) = BETA*Y( IY )
269 IF( LSAME( UPLO, 'U' ) ) THEN
271 * Form y when A is stored in upper triangle.
273 IF( ( INCX.EQ.1 ) .AND. ( INCY.EQ.1 ) ) THEN
278 Y( I ) = Y( I ) + TEMP1*A( I, J )
279 TEMP2 = TEMP2 + A( I, J )*X( I )
281 Y( J ) = Y( J ) + TEMP1*A( J, J ) + ALPHA*TEMP2
287 TEMP1 = ALPHA*X( JX )
292 Y( IY ) = Y( IY ) + TEMP1*A( I, J )
293 TEMP2 = TEMP2 + A( I, J )*X( IX )
297 Y( JY ) = Y( JY ) + TEMP1*A( J, J ) + ALPHA*TEMP2
304 * Form y when A is stored in lower triangle.
306 IF( ( INCX.EQ.1 ) .AND. ( INCY.EQ.1 ) ) THEN
310 Y( J ) = Y( J ) + TEMP1*A( J, J )
312 Y( I ) = Y( I ) + TEMP1*A( I, J )
313 TEMP2 = TEMP2 + A( I, J )*X( I )
315 Y( J ) = Y( J ) + ALPHA*TEMP2
321 TEMP1 = ALPHA*X( JX )
323 Y( JY ) = Y( JY ) + TEMP1*A( J, J )
329 Y( IY ) = Y( IY ) + TEMP1*A( I, J )
330 TEMP2 = TEMP2 + A( I, J )*X( IX )
332 Y( JY ) = Y( JY ) + ALPHA*TEMP2