1
SUBROUTINE ZGERU ( M, N, ALPHA, X, INCX, Y, INCY, A, LDA )
3
* =========== DOCUMENTATION ===========
5
* Online html documentation available at
6
* http://www.netlib.org/lapack/explore-html/
11
* SUBROUTINE ZGERU(M,N,ALPHA,X,INCX,Y,INCY,A,LDA)
13
* .. Scalar Arguments ..
15
* INTEGER INCX,INCY,LDA,M,N
17
* .. Array Arguments ..
18
* COMPLEX*16 A(LDA,*),X(*),Y(*)
27
*> ZGERU performs the rank 1 operation
29
*> A := alpha*x*y**T + A,
31
*> where alpha is a scalar, x is an m element vector, y is an n element
32
*> vector and A is an m by n matrix.
41
*> On entry, M specifies the number of rows of the matrix A.
42
*> M must be at least zero.
48
*> On entry, N specifies the number of columns of the matrix A.
49
*> N must be at least zero.
54
*> ALPHA is COMPLEX*16
55
*> On entry, ALPHA specifies the scalar alpha.
60
*> X is COMPLEX*16 array of dimension at least
61
*> ( 1 + ( m - 1 )*abs( INCX ) ).
62
*> Before entry, the incremented array X must contain the m
69
*> On entry, INCX specifies the increment for the elements of
70
*> X. INCX must not be zero.
75
*> Y is COMPLEX*16 array of dimension at least
76
*> ( 1 + ( n - 1 )*abs( INCY ) ).
77
*> Before entry, the incremented array Y must contain the n
84
*> On entry, INCY specifies the increment for the elements of
85
*> Y. INCY must not be zero.
90
*> A is COMPLEX*16 array of DIMENSION ( LDA, n ).
91
*> Before entry, the leading m by n part of the array A must
92
*> contain the matrix of coefficients. On exit, A is
93
*> overwritten by the updated matrix.
99
*> On entry, LDA specifies the first dimension of A as declared
100
*> in the calling (sub) program. LDA must be at least
107
*> \author Univ. of Tennessee
108
*> \author Univ. of California Berkeley
109
*> \author Univ. of Colorado Denver
112
*> \date November 2011
114
*> \ingroup complex16_blas_level2
116
*> \par Further Details:
117
* =====================
121
*> Level 2 Blas routine.
123
*> -- Written on 22-October-1986.
124
*> Jack Dongarra, Argonne National Lab.
125
*> Jeremy Du Croz, Nag Central Office.
126
*> Sven Hammarling, Nag Central Office.
127
*> Richard Hanson, Sandia National Labs.
130
* =====================================================================
131
SUBROUTINE ZGERU(M,N,ALPHA,X,INCX,Y,INCY,A,LDA)
133
* -- Reference BLAS level2 routine (version 3.4.0) --
134
* -- Reference BLAS is a software package provided by Univ. of Tennessee, --
135
* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
2
138
* .. Scalar Arguments ..
4
INTEGER INCX, INCY, LDA, M, N
140
INTEGER INCX,INCY,LDA,M,N
5
142
* .. Array Arguments ..
6
COMPLEX*16 A( LDA, * ), X( * ), Y( * )
143
COMPLEX*16 A(LDA,*),X(*),Y(*)
8
C $Id: zgeru.f 19695 2010-10-29 16:51:02Z d3y133 $
13
* ZGERU performs the rank 1 operation
15
* A := alpha*x*y' + A,
17
* where alpha is a scalar, x is an m element vector, y is an n element
18
* vector and A is an m by n matrix.
24
* On entry, M specifies the number of rows of the matrix A.
25
* M must be at least zero.
29
* On entry, N specifies the number of columns of the matrix A.
30
* N must be at least zero.
33
* ALPHA - COMPLEX*16 .
34
* On entry, ALPHA specifies the scalar alpha.
37
* X - COMPLEX*16 array of dimension at least
38
* ( 1 + ( m - 1 )*abs( INCX ) ).
39
* Before entry, the incremented array X must contain the m
44
* On entry, INCX specifies the increment for the elements of
45
* X. INCX must not be zero.
48
* Y - COMPLEX*16 array of dimension at least
49
* ( 1 + ( n - 1 )*abs( INCY ) ).
50
* Before entry, the incremented array Y must contain the n
55
* On entry, INCY specifies the increment for the elements of
56
* Y. INCY must not be zero.
59
* A - COMPLEX*16 array of DIMENSION ( LDA, n ).
60
* Before entry, the leading m by n part of the array A must
61
* contain the matrix of coefficients. On exit, A is
62
* overwritten by the updated matrix.
65
* On entry, LDA specifies the first dimension of A as declared
66
* in the calling (sub) program. LDA must be at least
71
* Level 2 Blas routine.
73
* -- Written on 22-October-1986.
74
* Jack Dongarra, Argonne National Lab.
75
* Jeremy Du Croz, Nag Central Office.
76
* Sven Hammarling, Nag Central Office.
77
* Richard Hanson, Sandia National Labs.
146
* =====================================================================
80
148
* .. Parameters ..
82
PARAMETER ( ZERO = ( 0.0D+0, 0.0D+0 ) )
150
PARAMETER (ZERO= (0.0D+0,0.0D+0))
83
152
* .. Local Scalars ..
85
INTEGER I, INFO, IX, J, JY, KX
154
INTEGER I,INFO,IX,J,JY,KX
86
156
* .. External Subroutines ..
88
159
* .. Intrinsic Functions ..
91
* .. Executable Statements ..
93
163
* Test the input parameters.
100
ELSE IF( INCX.EQ.0 )THEN
102
ELSE IF( INCY.EQ.0 )THEN
104
ELSE IF( LDA.LT.MAX( 1, M ) )THEN
168
ELSE IF (N.LT.0) THEN
170
ELSE IF (INCX.EQ.0) THEN
172
ELSE IF (INCY.EQ.0) THEN
174
ELSE IF (LDA.LT.MAX(1,M)) THEN
108
CALL XERBLA( 'ZGERU ', INFO )
178
CALL XERBLA('ZGERU ',INFO)
112
182
* Quick return if possible.
114
IF( ( M.EQ.0 ).OR.( N.EQ.0 ).OR.( ALPHA.EQ.ZERO ) )
184
IF ((M.EQ.0) .OR. (N.EQ.0) .OR. (ALPHA.EQ.ZERO)) RETURN
117
186
* Start the operations. In this version the elements of A are
118
187
* accessed sequentially with one pass through A.
123
JY = 1 - ( N - 1 )*INCY
127
IF( Y( JY ).NE.ZERO )THEN
130
A( I, J ) = A( I, J ) + X( I )*TEMP
196
IF (Y(JY).NE.ZERO) THEN
199
A(I,J) = A(I,J) + X(I)*TEMP
139
KX = 1 - ( M - 1 )*INCX
142
IF( Y( JY ).NE.ZERO )THEN
146
A( I, J ) = A( I, J ) + X( IX )*TEMP
211
IF (Y(JY).NE.ZERO) THEN
215
A(I,J) = A(I,J) + X(IX)*TEMP