1
SUBROUTINE SGER ( M, N, ALPHA, X, INCX, Y, INCY, A, LDA )
3
* $Id: sger.f 19695 2010-10-29 16:51:02Z d3y133 $
3
* =========== DOCUMENTATION ===========
5
* Online html documentation available at
6
* http://www.netlib.org/lapack/explore-html/
11
* SUBROUTINE SGER(M,N,ALPHA,X,INCX,Y,INCY,A,LDA)
13
* .. Scalar Arguments ..
15
* INTEGER INCX,INCY,LDA,M,N
17
* .. Array Arguments ..
18
* REAL A(LDA,*),X(*),Y(*)
27
*> SGER 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.
55
*> On entry, ALPHA specifies the scalar alpha.
60
*> X is REAL 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 REAL 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 REAL 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 single_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 SGER(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..--
5
138
* .. Scalar Arguments ..
7
INTEGER INCX, INCY, LDA, M, N
140
INTEGER INCX,INCY,LDA,M,N
8
142
* .. Array Arguments ..
9
REAL A( LDA, * ), X( * ), Y( * )
143
REAL A(LDA,*),X(*),Y(*)
15
* SGER performs the rank 1 operation
17
* A := alpha*x*y' + A,
19
* where alpha is a scalar, x is an m element vector, y is an n element
20
* vector and A is an m by n matrix.
26
* On entry, M specifies the number of rows of the matrix A.
27
* M must be at least zero.
31
* On entry, N specifies the number of columns of the matrix A.
32
* N must be at least zero.
36
* On entry, ALPHA specifies the scalar alpha.
39
* X - REAL array of dimension at least
40
* ( 1 + ( m - 1 )*abs( INCX ) ).
41
* Before entry, the incremented array X must contain the m
46
* On entry, INCX specifies the increment for the elements of
47
* X. INCX must not be zero.
50
* Y - REAL array of dimension at least
51
* ( 1 + ( n - 1 )*abs( INCY ) ).
52
* Before entry, the incremented array Y must contain the n
57
* On entry, INCY specifies the increment for the elements of
58
* Y. INCY must not be zero.
61
* A - REAL array of DIMENSION ( LDA, n ).
62
* Before entry, the leading m by n part of the array A must
63
* contain the matrix of coefficients. On exit, A is
64
* overwritten by the updated matrix.
67
* On entry, LDA specifies the first dimension of A as declared
68
* in the calling (sub) program. LDA must be at least
73
* Level 2 Blas routine.
75
* -- Written on 22-October-1986.
76
* Jack Dongarra, Argonne National Lab.
77
* Jeremy Du Croz, Nag Central Office.
78
* Sven Hammarling, Nag Central Office.
79
* Richard Hanson, Sandia National Labs.
146
* =====================================================================
82
148
* .. Parameters ..
84
PARAMETER ( ZERO = 0.0E+0 )
150
PARAMETER (ZERO=0.0E+0)
85
152
* .. Local Scalars ..
87
INTEGER I, INFO, IX, J, JY, KX
154
INTEGER I,INFO,IX,J,JY,KX
88
156
* .. External Subroutines ..
90
159
* .. Intrinsic Functions ..
93
* .. Executable Statements ..
95
163
* Test the input parameters.
100
ELSE IF( N.LT.0 )THEN
102
ELSE IF( INCX.EQ.0 )THEN
104
ELSE IF( INCY.EQ.0 )THEN
106
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
110
CALL XERBLA( 'SGER ', INFO )
178
CALL XERBLA('SGER ',INFO)
114
182
* Quick return if possible.
116
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
119
186
* Start the operations. In this version the elements of A are
120
187
* accessed sequentially with one pass through A.
125
JY = 1 - ( N - 1 )*INCY
129
IF( Y( JY ).NE.ZERO )THEN
132
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
141
KX = 1 - ( M - 1 )*INCX
144
IF( Y( JY ).NE.ZERO )THEN
148
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