3 /* Subroutine */ int sger_(integer *m, integer *n, real *alpha, real *x,
4 integer *incx, real *y, integer *incy, real *a, integer *lda)
6 /* System generated locals */
7 integer a_dim1, a_offset, i__1, i__2;
10 integer i__, j, ix, jy, kx, info;
12 extern /* Subroutine */ int xerbla_(char *, integer *);
14 /* .. Scalar Arguments .. */
16 /* .. Array Arguments .. */
22 /* SGER performs the rank 1 operation */
24 /* A := alpha*x*y' + A, */
26 /* where alpha is a scalar, x is an m element vector, y is an n element */
27 /* vector and A is an m by n matrix. */
33 /* On entry, M specifies the number of rows of the matrix A. */
34 /* M must be at least zero. */
35 /* Unchanged on exit. */
38 /* On entry, N specifies the number of columns of the matrix A. */
39 /* N must be at least zero. */
40 /* Unchanged on exit. */
43 /* On entry, ALPHA specifies the scalar alpha. */
44 /* Unchanged on exit. */
46 /* X - REAL array of dimension at least */
47 /* ( 1 + ( m - 1 )*abs( INCX ) ). */
48 /* Before entry, the incremented array X must contain the m */
49 /* element vector x. */
50 /* Unchanged on exit. */
53 /* On entry, INCX specifies the increment for the elements of */
54 /* X. INCX must not be zero. */
55 /* Unchanged on exit. */
57 /* Y - REAL array of dimension at least */
58 /* ( 1 + ( n - 1 )*abs( INCY ) ). */
59 /* Before entry, the incremented array Y must contain the n */
60 /* element vector y. */
61 /* Unchanged on exit. */
64 /* On entry, INCY specifies the increment for the elements of */
65 /* Y. INCY must not be zero. */
66 /* Unchanged on exit. */
68 /* A - REAL array of DIMENSION ( LDA, n ). */
69 /* Before entry, the leading m by n part of the array A must */
70 /* contain the matrix of coefficients. On exit, A is */
71 /* overwritten by the updated matrix. */
74 /* On entry, LDA specifies the first dimension of A as declared */
75 /* in the calling (sub) program. LDA must be at least */
77 /* Unchanged on exit. */
80 /* Level 2 Blas routine. */
82 /* -- Written on 22-October-1986. */
83 /* Jack Dongarra, Argonne National Lab. */
84 /* Jeremy Du Croz, Nag Central Office. */
85 /* Sven Hammarling, Nag Central Office. */
86 /* Richard Hanson, Sandia National Labs. */
89 /* .. Parameters .. */
91 /* .. Local Scalars .. */
93 /* .. External Subroutines .. */
95 /* .. Intrinsic Functions .. */
98 /* Test the input parameters. */
100 /* Parameter adjustments */
104 a_offset = 1 + a_dim1;
113 } else if (*incx == 0) {
115 } else if (*incy == 0) {
117 } else if (*lda < max(1,*m)) {
121 xerbla_("SGER ", &info);
125 /* Quick return if possible. */
127 if (*m == 0 || *n == 0 || *alpha == 0.f) {
131 /* Start the operations. In this version the elements of A are */
132 /* accessed sequentially with one pass through A. */
137 jy = 1 - (*n - 1) * *incy;
141 for (j = 1; j <= i__1; ++j) {
143 temp = *alpha * y[jy];
145 for (i__ = 1; i__ <= i__2; ++i__) {
146 a[i__ + j * a_dim1] += x[i__] * temp;
157 kx = 1 - (*m - 1) * *incx;
160 for (j = 1; j <= i__1; ++j) {
162 temp = *alpha * y[jy];
165 for (i__ = 1; i__ <= i__2; ++i__) {
166 a[i__ + j * a_dim1] += x[ix] * temp;