File:  [local] / rpl / lapack / blas / dsdot.f
Revision 1.13: download - view: text, annotated - select for diffs - revision graph
Mon Aug 7 08:38:43 2023 UTC (8 months, 3 weeks ago) by bertrand
Branches: MAIN
CVS tags: rpl-4_1_35, rpl-4_1_34, HEAD
Première mise à jour de lapack et blas.

    1: *> \brief \b DSDOT
    2: *
    3: *  =========== DOCUMENTATION ===========
    4: *
    5: * Online html documentation available at
    6: *            http://www.netlib.org/lapack/explore-html/
    7: *
    8: *  Definition:
    9: *  ===========
   10: *
   11: *       DOUBLE PRECISION FUNCTION DSDOT(N,SX,INCX,SY,INCY)
   12: *
   13: *       .. Scalar Arguments ..
   14: *       INTEGER INCX,INCY,N
   15: *       ..
   16: *       .. Array Arguments ..
   17: *       REAL SX(*),SY(*)
   18: *       ..
   19: *
   20: *    AUTHORS
   21: *    =======
   22: *    Lawson, C. L., (JPL), Hanson, R. J., (SNLA),
   23: *    Kincaid, D. R., (U. of Texas), Krogh, F. T., (JPL)
   24: *
   25: *
   26: *> \par Purpose:
   27: *  =============
   28: *>
   29: *> \verbatim
   30: *>
   31: *> Compute the inner product of two vectors with extended
   32: *> precision accumulation and result.
   33: *>
   34: *> Returns D.P. dot product accumulated in D.P., for S.P. SX and SY
   35: *> DSDOT = sum for I = 0 to N-1 of  SX(LX+I*INCX) * SY(LY+I*INCY),
   36: *> where LX = 1 if INCX .GE. 0, else LX = 1+(1-N)*INCX, and LY is
   37: *> defined in a similar way using INCY.
   38: *> \endverbatim
   39: *
   40: *  Arguments:
   41: *  ==========
   42: *
   43: *> \param[in] N
   44: *> \verbatim
   45: *>          N is INTEGER
   46: *>         number of elements in input vector(s)
   47: *> \endverbatim
   48: *>
   49: *> \param[in] SX
   50: *> \verbatim
   51: *>          SX is REAL array, dimension(N)
   52: *>         single precision vector with N elements
   53: *> \endverbatim
   54: *>
   55: *> \param[in] INCX
   56: *> \verbatim
   57: *>          INCX is INTEGER
   58: *>          storage spacing between elements of SX
   59: *> \endverbatim
   60: *>
   61: *> \param[in] SY
   62: *> \verbatim
   63: *>          SY is REAL array, dimension(N)
   64: *>         single precision vector with N elements
   65: *> \endverbatim
   66: *>
   67: *> \param[in] INCY
   68: *> \verbatim
   69: *>          INCY is INTEGER
   70: *>         storage spacing between elements of SY
   71: *> \endverbatim
   72: *>
   73: *> \result DSDOT
   74: *> \verbatim
   75: *>          DSDOT is DOUBLE PRECISION
   76: *>         DSDOT  double precision dot product (zero if N.LE.0)
   77: *> \endverbatim
   78: *
   79: *  Authors:
   80: *  ========
   81: *
   82: *> \author Univ. of Tennessee
   83: *> \author Univ. of California Berkeley
   84: *> \author Univ. of Colorado Denver
   85: *> \author NAG Ltd.
   86: *
   87: *> \ingroup double_blas_level1
   88: *
   89: *> \par Further Details:
   90: *  =====================
   91: *>
   92: *> \verbatim
   93: *> \endverbatim
   94: *
   95: *> \par References:
   96: *  ================
   97: *>
   98: *> \verbatim
   99: *>
  100: *>
  101: *>  C. L. Lawson, R. J. Hanson, D. R. Kincaid and F. T.
  102: *>  Krogh, Basic linear algebra subprograms for Fortran
  103: *>  usage, Algorithm No. 539, Transactions on Mathematical
  104: *>  Software 5, 3 (September 1979), pp. 308-323.
  105: *>
  106: *>  REVISION HISTORY  (YYMMDD)
  107: *>
  108: *>  791001  DATE WRITTEN
  109: *>  890831  Modified array declarations.  (WRB)
  110: *>  890831  REVISION DATE from Version 3.2
  111: *>  891214  Prologue converted to Version 4.0 format.  (BAB)
  112: *>  920310  Corrected definition of LX in DESCRIPTION.  (WRB)
  113: *>  920501  Reformatted the REFERENCES section.  (WRB)
  114: *>  070118  Reformat to LAPACK style (JL)
  115: *> \endverbatim
  116: *>
  117: *  =====================================================================
  118:       DOUBLE PRECISION FUNCTION DSDOT(N,SX,INCX,SY,INCY)
  119: *
  120: *  -- Reference BLAS level1 routine --
  121: *  -- Reference BLAS is a software package provided by Univ. of Tennessee,    --
  122: *  -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
  123: *
  124: *     .. Scalar Arguments ..
  125:       INTEGER INCX,INCY,N
  126: *     ..
  127: *     .. Array Arguments ..
  128:       REAL SX(*),SY(*)
  129: *     ..
  130: *
  131: *  Authors:
  132: *  ========
  133: *  Lawson, C. L., (JPL), Hanson, R. J., (SNLA),
  134: *  Kincaid, D. R., (U. of Texas), Krogh, F. T., (JPL)
  135: *
  136: *  =====================================================================
  137: *
  138: *     .. Local Scalars ..
  139:       INTEGER I,KX,KY,NS
  140: *     ..
  141: *     .. Intrinsic Functions ..
  142:       INTRINSIC DBLE
  143: *     ..
  144:       DSDOT = 0.0D0
  145:       IF (N.LE.0) RETURN
  146:       IF (INCX.EQ.INCY .AND. INCX.GT.0) THEN
  147: *
  148: *     Code for equal, positive, non-unit increments.
  149: *
  150:          NS = N*INCX
  151:          DO I = 1,NS,INCX
  152:             DSDOT = DSDOT + DBLE(SX(I))*DBLE(SY(I))
  153:          END DO
  154:       ELSE
  155: *
  156: *     Code for unequal or nonpositive increments.
  157: *
  158:          KX = 1
  159:          KY = 1
  160:          IF (INCX.LT.0) KX = 1 + (1-N)*INCX
  161:          IF (INCY.LT.0) KY = 1 + (1-N)*INCY
  162:          DO I = 1,N
  163:             DSDOT = DSDOT + DBLE(SX(KX))*DBLE(SY(KY))
  164:             KX = KX + INCX
  165:             KY = KY + INCY
  166:          END DO
  167:       END IF
  168:       RETURN
  169: *
  170: *     End of DSDOT
  171: *
  172:       END

CVSweb interface <joel.bertrand@systella.fr>