LAPACK  3.4.1
LAPACK: Linear Algebra PACKage
dger.f
Go to the documentation of this file.
00001 *> \brief \b DGER
00002 *
00003 *  =========== DOCUMENTATION ===========
00004 *
00005 * Online html documentation available at 
00006 *            http://www.netlib.org/lapack/explore-html/ 
00007 *
00008 *  Definition:
00009 *  ===========
00010 *
00011 *       SUBROUTINE DGER(M,N,ALPHA,X,INCX,Y,INCY,A,LDA)
00012 * 
00013 *       .. Scalar Arguments ..
00014 *       DOUBLE PRECISION ALPHA
00015 *       INTEGER INCX,INCY,LDA,M,N
00016 *       ..
00017 *       .. Array Arguments ..
00018 *       DOUBLE PRECISION A(LDA,*),X(*),Y(*)
00019 *       ..
00020 *  
00021 *
00022 *> \par Purpose:
00023 *  =============
00024 *>
00025 *> \verbatim
00026 *>
00027 *> DGER   performs the rank 1 operation
00028 *>
00029 *>    A := alpha*x*y**T + A,
00030 *>
00031 *> where alpha is a scalar, x is an m element vector, y is an n element
00032 *> vector and A is an m by n matrix.
00033 *> \endverbatim
00034 *
00035 *  Arguments:
00036 *  ==========
00037 *
00038 *> \param[in] M
00039 *> \verbatim
00040 *>          M is INTEGER
00041 *>           On entry, M specifies the number of rows of the matrix A.
00042 *>           M must be at least zero.
00043 *> \endverbatim
00044 *>
00045 *> \param[in] N
00046 *> \verbatim
00047 *>          N is INTEGER
00048 *>           On entry, N specifies the number of columns of the matrix A.
00049 *>           N must be at least zero.
00050 *> \endverbatim
00051 *>
00052 *> \param[in] ALPHA
00053 *> \verbatim
00054 *>          ALPHA is DOUBLE PRECISION.
00055 *>           On entry, ALPHA specifies the scalar alpha.
00056 *> \endverbatim
00057 *>
00058 *> \param[in] X
00059 *> \verbatim
00060 *>          X is DOUBLE PRECISION array of dimension at least
00061 *>           ( 1 + ( m - 1 )*abs( INCX ) ).
00062 *>           Before entry, the incremented array X must contain the m
00063 *>           element vector x.
00064 *> \endverbatim
00065 *>
00066 *> \param[in] INCX
00067 *> \verbatim
00068 *>          INCX is INTEGER
00069 *>           On entry, INCX specifies the increment for the elements of
00070 *>           X. INCX must not be zero.
00071 *> \endverbatim
00072 *>
00073 *> \param[in] Y
00074 *> \verbatim
00075 *>          Y is DOUBLE PRECISION array of dimension at least
00076 *>           ( 1 + ( n - 1 )*abs( INCY ) ).
00077 *>           Before entry, the incremented array Y must contain the n
00078 *>           element vector y.
00079 *> \endverbatim
00080 *>
00081 *> \param[in] INCY
00082 *> \verbatim
00083 *>          INCY is INTEGER
00084 *>           On entry, INCY specifies the increment for the elements of
00085 *>           Y. INCY must not be zero.
00086 *> \endverbatim
00087 *>
00088 *> \param[in,out] A
00089 *> \verbatim
00090 *>          A is DOUBLE PRECISION array of DIMENSION ( LDA, n ).
00091 *>           Before entry, the leading m by n part of the array A must
00092 *>           contain the matrix of coefficients. On exit, A is
00093 *>           overwritten by the updated matrix.
00094 *> \endverbatim
00095 *>
00096 *> \param[in] LDA
00097 *> \verbatim
00098 *>          LDA is INTEGER
00099 *>           On entry, LDA specifies the first dimension of A as declared
00100 *>           in the calling (sub) program. LDA must be at least
00101 *>           max( 1, m ).
00102 *> \endverbatim
00103 *
00104 *  Authors:
00105 *  ========
00106 *
00107 *> \author Univ. of Tennessee 
00108 *> \author Univ. of California Berkeley 
00109 *> \author Univ. of Colorado Denver 
00110 *> \author NAG Ltd. 
00111 *
00112 *> \date November 2011
00113 *
00114 *> \ingroup double_blas_level2
00115 *
00116 *> \par Further Details:
00117 *  =====================
00118 *>
00119 *> \verbatim
00120 *>
00121 *>  Level 2 Blas routine.
00122 *>
00123 *>  -- Written on 22-October-1986.
00124 *>     Jack Dongarra, Argonne National Lab.
00125 *>     Jeremy Du Croz, Nag Central Office.
00126 *>     Sven Hammarling, Nag Central Office.
00127 *>     Richard Hanson, Sandia National Labs.
00128 *> \endverbatim
00129 *>
00130 *  =====================================================================
00131       SUBROUTINE DGER(M,N,ALPHA,X,INCX,Y,INCY,A,LDA)
00132 *
00133 *  -- Reference BLAS level2 routine (version 3.4.0) --
00134 *  -- Reference BLAS is a software package provided by Univ. of Tennessee,    --
00135 *  -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
00136 *     November 2011
00137 *
00138 *     .. Scalar Arguments ..
00139       DOUBLE PRECISION ALPHA
00140       INTEGER INCX,INCY,LDA,M,N
00141 *     ..
00142 *     .. Array Arguments ..
00143       DOUBLE PRECISION A(LDA,*),X(*),Y(*)
00144 *     ..
00145 *
00146 *  =====================================================================
00147 *
00148 *     .. Parameters ..
00149       DOUBLE PRECISION ZERO
00150       PARAMETER (ZERO=0.0D+0)
00151 *     ..
00152 *     .. Local Scalars ..
00153       DOUBLE PRECISION TEMP
00154       INTEGER I,INFO,IX,J,JY,KX
00155 *     ..
00156 *     .. External Subroutines ..
00157       EXTERNAL XERBLA
00158 *     ..
00159 *     .. Intrinsic Functions ..
00160       INTRINSIC MAX
00161 *     ..
00162 *
00163 *     Test the input parameters.
00164 *
00165       INFO = 0
00166       IF (M.LT.0) THEN
00167           INFO = 1
00168       ELSE IF (N.LT.0) THEN
00169           INFO = 2
00170       ELSE IF (INCX.EQ.0) THEN
00171           INFO = 5
00172       ELSE IF (INCY.EQ.0) THEN
00173           INFO = 7
00174       ELSE IF (LDA.LT.MAX(1,M)) THEN
00175           INFO = 9
00176       END IF
00177       IF (INFO.NE.0) THEN
00178           CALL XERBLA('DGER  ',INFO)
00179           RETURN
00180       END IF
00181 *
00182 *     Quick return if possible.
00183 *
00184       IF ((M.EQ.0) .OR. (N.EQ.0) .OR. (ALPHA.EQ.ZERO)) RETURN
00185 *
00186 *     Start the operations. In this version the elements of A are
00187 *     accessed sequentially with one pass through A.
00188 *
00189       IF (INCY.GT.0) THEN
00190           JY = 1
00191       ELSE
00192           JY = 1 - (N-1)*INCY
00193       END IF
00194       IF (INCX.EQ.1) THEN
00195           DO 20 J = 1,N
00196               IF (Y(JY).NE.ZERO) THEN
00197                   TEMP = ALPHA*Y(JY)
00198                   DO 10 I = 1,M
00199                       A(I,J) = A(I,J) + X(I)*TEMP
00200    10             CONTINUE
00201               END IF
00202               JY = JY + INCY
00203    20     CONTINUE
00204       ELSE
00205           IF (INCX.GT.0) THEN
00206               KX = 1
00207           ELSE
00208               KX = 1 - (M-1)*INCX
00209           END IF
00210           DO 40 J = 1,N
00211               IF (Y(JY).NE.ZERO) THEN
00212                   TEMP = ALPHA*Y(JY)
00213                   IX = KX
00214                   DO 30 I = 1,M
00215                       A(I,J) = A(I,J) + X(IX)*TEMP
00216                       IX = IX + INCX
00217    30             CONTINUE
00218               END IF
00219               JY = JY + INCY
00220    40     CONTINUE
00221       END IF
00222 *
00223       RETURN
00224 *
00225 *     End of DGER  .
00226 *
00227       END
 All Files Functions