SDSDOT(1)

NAME

SYNOPSIS

REAL FUNCTION
    SDSDOT(N,SB,SX,INCX,SY,INCY)

REAL
    SB

INTEGER
    INCX,INCY,N

REAL
    SX(*),SY(*)

DOUBLE
    PRECISION DSDOT

INTEGER
    I,KX,KY,NS

INTRINSIC
    DBLE

DSDOT
    = SB

IF  (N.LE.0) THEN

SDSDOT
    = DSDOT

RETURN

END IF

IF  (INCX.EQ.INCY .AND. INCX.GT.0) THEN

NS  = N*INCX

DO  I = 1,NS,INCX

DSDOT
    = DSDOT + DBLE(SX(I))*DBLE(SY(I))

END DO

ELSE

KX  = 1

KY  = 1

IF  (INCX.LT.0) KX = 1 + (1-N)*INCX

IF  (INCY.LT.0) KY = 1 + (1-N)*INCY

DO  I = 1,N

DSDOT
    = DSDOT + DBLE(SX(KX))*DBLE(SY(KY))

KX  = KX + INCX

KY  = KY + INCY

END DO

END IF

SDSDOT
    = DSDOT

RETURN

END

PURPOSE