|
kusano |
2b45e8 |
*DECK SDSDOTF
|
|
kusano |
2b45e8 |
REAL FUNCTION SDSDOTF (N, SB, SX, INCX, SY, INCY)
|
|
kusano |
2b45e8 |
C***BEGIN PROLOGUE SDSDOT
|
|
kusano |
2b45e8 |
C***PURPOSE Compute the inner product of two vectors with extended
|
|
kusano |
2b45e8 |
C precision accumulation.
|
|
kusano |
2b45e8 |
C***LIBRARY SLATEC (BLAS)
|
|
kusano |
2b45e8 |
C***CATEGORY D1A4
|
|
kusano |
2b45e8 |
C***TYPE SINGLE PRECISION (SDSDOT-S, CDCDOT-C)
|
|
kusano |
2b45e8 |
C***KEYWORDS BLAS, DOT PRODUCT, INNER PRODUCT, LINEAR ALGEBRA, VECTOR
|
|
kusano |
2b45e8 |
C***AUTHOR Lawson, C. L., (JPL)
|
|
kusano |
2b45e8 |
C Hanson, R. J., (SNLA)
|
|
kusano |
2b45e8 |
C Kincaid, D. R., (U. of Texas)
|
|
kusano |
2b45e8 |
C Krogh, F. T., (JPL)
|
|
kusano |
2b45e8 |
C***DESCRIPTION
|
|
kusano |
2b45e8 |
C
|
|
kusano |
2b45e8 |
C B L A S Subprogram
|
|
kusano |
2b45e8 |
C Description of Parameters
|
|
kusano |
2b45e8 |
C
|
|
kusano |
2b45e8 |
C --Input--
|
|
kusano |
2b45e8 |
C N number of elements in input vector(s)
|
|
kusano |
2b45e8 |
C SB single precision scalar to be added to inner product
|
|
kusano |
2b45e8 |
C SX single precision vector with N elements
|
|
kusano |
2b45e8 |
C INCX storage spacing between elements of SX
|
|
kusano |
2b45e8 |
C SY single precision vector with N elements
|
|
kusano |
2b45e8 |
C INCY storage spacing between elements of SY
|
|
kusano |
2b45e8 |
C
|
|
kusano |
2b45e8 |
C --Output--
|
|
kusano |
2b45e8 |
C SDSDOT single precision dot product (SB if N .LE. 0)
|
|
kusano |
2b45e8 |
C
|
|
kusano |
2b45e8 |
C Returns S.P. result with dot product accumulated in D.P.
|
|
kusano |
2b45e8 |
C SDSDOT = SB + sum for I = 0 to N-1 of SX(LX+I*INCX)*SY(LY+I*INCY),
|
|
kusano |
2b45e8 |
C where LX = 1 if INCX .GE. 0, else LX = 1+(1-N)*INCX, and LY is
|
|
kusano |
2b45e8 |
C defined in a similar way using INCY.
|
|
kusano |
2b45e8 |
C
|
|
kusano |
2b45e8 |
C***REFERENCES C. L. Lawson, R. J. Hanson, D. R. Kincaid and F. T.
|
|
kusano |
2b45e8 |
C Krogh, Basic linear algebra subprograms for Fortran
|
|
kusano |
2b45e8 |
C usage, Algorithm No. 539, Transactions on Mathematical
|
|
kusano |
2b45e8 |
C Software 5, 3 (September 1979), pp. 308-323.
|
|
kusano |
2b45e8 |
C***ROUTINES CALLED (NONE)
|
|
kusano |
2b45e8 |
C***REVISION HISTORY (YYMMDD)
|
|
kusano |
2b45e8 |
C 791001 DATE WRITTEN
|
|
kusano |
2b45e8 |
C 890531 Changed all specific intrinsics to generic. (WRB)
|
|
kusano |
2b45e8 |
C 890831 Modified array declarations. (WRB)
|
|
kusano |
2b45e8 |
C 890831 REVISION DATE from Version 3.2
|
|
kusano |
2b45e8 |
C 891214 Prologue converted to Version 4.0 format. (BAB)
|
|
kusano |
2b45e8 |
C 920310 Corrected definition of LX in DESCRIPTION. (WRB)
|
|
kusano |
2b45e8 |
C 920501 Reformatted the REFERENCES section. (WRB)
|
|
kusano |
2b45e8 |
C***END PROLOGUE SDSDOT
|
|
kusano |
2b45e8 |
REAL SX(*), SY(*), SB
|
|
kusano |
2b45e8 |
DOUBLE PRECISION DSDOT
|
|
kusano |
2b45e8 |
C***FIRST EXECUTABLE STATEMENT SDSDOT
|
|
kusano |
2b45e8 |
DSDOT = SB
|
|
kusano |
2b45e8 |
IF (N .LE. 0) GO TO 30
|
|
kusano |
2b45e8 |
IF (INCX.EQ.INCY .AND. INCX.GT.0) GO TO 40
|
|
kusano |
2b45e8 |
C
|
|
kusano |
2b45e8 |
C Code for unequal or nonpositive increments.
|
|
kusano |
2b45e8 |
C
|
|
kusano |
2b45e8 |
KX = 1
|
|
kusano |
2b45e8 |
KY = 1
|
|
kusano |
2b45e8 |
IF (INCX .LT. 0) KX = 1+(1-N)*INCX
|
|
kusano |
2b45e8 |
IF (INCY .LT. 0) KY = 1+(1-N)*INCY
|
|
kusano |
2b45e8 |
DO 10 I = 1,N
|
|
kusano |
2b45e8 |
DSDOT = DSDOT + DBLE(SX(KX))*DBLE(SY(KY))
|
|
kusano |
2b45e8 |
KX = KX + INCX
|
|
kusano |
2b45e8 |
KY = KY + INCY
|
|
kusano |
2b45e8 |
10 CONTINUE
|
|
kusano |
2b45e8 |
30 SDSDOTF = DSDOT
|
|
kusano |
2b45e8 |
RETURN
|
|
kusano |
2b45e8 |
C
|
|
kusano |
2b45e8 |
C Code for equal and positive increments.
|
|
kusano |
2b45e8 |
C
|
|
kusano |
2b45e8 |
40 NS = N*INCX
|
|
kusano |
2b45e8 |
DO 50 I = 1,NS,INCX
|
|
kusano |
2b45e8 |
DSDOT = DSDOT + DBLE(SX(I))*DBLE(SY(I))
|
|
kusano |
2b45e8 |
50 CONTINUE
|
|
kusano |
2b45e8 |
SDSDOTF = DSDOT
|
|
kusano |
2b45e8 |
RETURN
|
|
kusano |
2b45e8 |
END
|