![]() |
LAPACK
3.4.1
LAPACK: Linear Algebra PACKage
|
00001 *> \brief \b SDSDOT 00002 * 00003 * =========== DOCUMENTATION =========== 00004 * 00005 * Online html documentation available at 00006 * http://www.netlib.org/lapack/explore-html/ 00007 * 00008 * Definition: 00009 * =========== 00010 * 00011 * REAL FUNCTION SDSDOT(N,SB,SX,INCX,SY,INCY) 00012 * 00013 * .. Scalar Arguments .. 00014 * REAL SB 00015 * INTEGER INCX,INCY,N 00016 * .. 00017 * .. Array Arguments .. 00018 * REAL SX(*),SY(*) 00019 * .. 00020 * 00021 * PURPOSE 00022 * ======= 00023 * 00024 * Compute the inner product of two vectors with extended 00025 * precision accumulation. 00026 * 00027 * Returns S.P. result with dot product accumulated in D.P. 00028 * SDSDOT = SB + sum for I = 0 to N-1 of SX(LX+I*INCX)*SY(LY+I*INCY), 00029 * where LX = 1 if INCX .GE. 0, else LX = 1+(1-N)*INCX, and LY is 00030 * defined in a similar way using INCY. 00031 * 00032 * AUTHOR 00033 * ====== 00034 * Lawson, C. L., (JPL), Hanson, R. J., (SNLA), 00035 * Kincaid, D. R., (U. of Texas), Krogh, F. T., (JPL) 00036 * 00037 * ARGUMENTS 00038 * ========= 00039 * 00040 * N (input) INTEGER 00041 * number of elements in input vector(s) 00042 * 00043 * SB (input) REAL 00044 * single precision scalar to be added to inner product 00045 * 00046 * SX (input) REAL array, dimension (N) 00047 * single precision vector with N elements 00048 * 00049 * INCX (input) INTEGER 00050 * storage spacing between elements of SX 00051 * 00052 * SY (input) REAL array, dimension (N) 00053 * single precision vector with N elements 00054 * 00055 * INCY (input) INTEGER 00056 * storage spacing between elements of SY 00057 * 00058 * SDSDOT (output) REAL 00059 * single precision dot product (SB if N .LE. 0) 00060 * 00061 * Further Details 00062 * =============== 00063 * 00064 * REFERENCES 00065 * 00066 * C. L. Lawson, R. J. Hanson, D. R. Kincaid and F. T. 00067 * Krogh, Basic linear algebra subprograms for Fortran 00068 * usage, Algorithm No. 539, Transactions on Mathematical 00069 * Software 5, 3 (September 1979), pp. 308-323. 00070 * 00071 * REVISION HISTORY (YYMMDD) 00072 * 00073 * 791001 DATE WRITTEN 00074 * 890531 Changed all specific intrinsics to generic. (WRB) 00075 * 890831 Modified array declarations. (WRB) 00076 * 890831 REVISION DATE from Version 3.2 00077 * 891214 Prologue converted to Version 4.0 format. (BAB) 00078 * 920310 Corrected definition of LX in DESCRIPTION. (WRB) 00079 * 920501 Reformatted the REFERENCES section. (WRB) 00080 * 070118 Reformat to LAPACK coding style 00081 * 00082 * ===================================================================== 00083 * 00084 * .. Local Scalars .. 00085 * DOUBLE PRECISION DSDOT 00086 * INTEGER I,KX,KY,NS 00087 * .. 00088 * .. Intrinsic Functions .. 00089 * INTRINSIC DBLE 00090 * .. 00091 * DSDOT = SB 00092 * IF (N.LE.0) THEN 00093 * SDSDOT = DSDOT 00094 * RETURN 00095 * END IF 00096 * IF (INCX.EQ.INCY .AND. INCX.GT.0) THEN 00097 * 00098 * Code for equal and positive increments. 00099 * 00100 * NS = N*INCX 00101 * DO I = 1,NS,INCX 00102 * DSDOT = DSDOT + DBLE(SX(I))*DBLE(SY(I)) 00103 * END DO 00104 * ELSE 00105 * 00106 * Code for unequal or nonpositive increments. 00107 * 00108 * KX = 1 00109 * KY = 1 00110 * IF (INCX.LT.0) KX = 1 + (1-N)*INCX 00111 * IF (INCY.LT.0) KY = 1 + (1-N)*INCY 00112 * DO I = 1,N 00113 * DSDOT = DSDOT + DBLE(SX(KX))*DBLE(SY(KY)) 00114 * KX = KX + INCX 00115 * KY = KY + INCY 00116 * END DO 00117 * END IF 00118 * SDSDOT = DSDOT 00119 * RETURN 00120 * END 00121 * 00122 *> \par Purpose: 00123 * ============= 00124 *> 00125 *> \verbatim 00126 *> \endverbatim 00127 * 00128 * Authors: 00129 * ======== 00130 * 00131 *> \author Univ. of Tennessee 00132 *> \author Univ. of California Berkeley 00133 *> \author Univ. of Colorado Denver 00134 *> \author NAG Ltd. 00135 * 00136 *> \date November 2011 00137 * 00138 *> \ingroup single_blas_level1 00139 * 00140 * ===================================================================== 00141 REAL FUNCTION SDSDOT(N,SB,SX,INCX,SY,INCY) 00142 * 00143 * -- Reference BLAS level1 routine (version 3.4.0) -- 00144 * -- Reference BLAS is a software package provided by Univ. of Tennessee, -- 00145 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- 00146 * November 2011 00147 * 00148 * .. Scalar Arguments .. 00149 REAL SB 00150 INTEGER INCX,INCY,N 00151 * .. 00152 * .. Array Arguments .. 00153 REAL SX(*),SY(*) 00154 * .. 00155 * 00156 * PURPOSE 00157 * ======= 00158 * 00159 * Compute the inner product of two vectors with extended 00160 * precision accumulation. 00161 * 00162 * Returns S.P. result with dot product accumulated in D.P. 00163 * SDSDOT = SB + sum for I = 0 to N-1 of SX(LX+I*INCX)*SY(LY+I*INCY), 00164 * where LX = 1 if INCX .GE. 0, else LX = 1+(1-N)*INCX, and LY is 00165 * defined in a similar way using INCY. 00166 * 00167 * AUTHOR 00168 * ====== 00169 * Lawson, C. L., (JPL), Hanson, R. J., (SNLA), 00170 * Kincaid, D. R., (U. of Texas), Krogh, F. T., (JPL) 00171 * 00172 * ARGUMENTS 00173 * ========= 00174 * 00175 * N (input) INTEGER 00176 * number of elements in input vector(s) 00177 * 00178 * SB (input) REAL 00179 * single precision scalar to be added to inner product 00180 * 00181 * SX (input) REAL array, dimension (N) 00182 * single precision vector with N elements 00183 * 00184 * INCX (input) INTEGER 00185 * storage spacing between elements of SX 00186 * 00187 * SY (input) REAL array, dimension (N) 00188 * single precision vector with N elements 00189 * 00190 * INCY (input) INTEGER 00191 * storage spacing between elements of SY 00192 * 00193 * SDSDOT (output) REAL 00194 * single precision dot product (SB if N .LE. 0) 00195 * 00196 * Further Details 00197 * =============== 00198 * 00199 * REFERENCES 00200 * 00201 * C. L. Lawson, R. J. Hanson, D. R. Kincaid and F. T. 00202 * Krogh, Basic linear algebra subprograms for Fortran 00203 * usage, Algorithm No. 539, Transactions on Mathematical 00204 * Software 5, 3 (September 1979), pp. 308-323. 00205 * 00206 * REVISION HISTORY (YYMMDD) 00207 * 00208 * 791001 DATE WRITTEN 00209 * 890531 Changed all specific intrinsics to generic. (WRB) 00210 * 890831 Modified array declarations. (WRB) 00211 * 890831 REVISION DATE from Version 3.2 00212 * 891214 Prologue converted to Version 4.0 format. (BAB) 00213 * 920310 Corrected definition of LX in DESCRIPTION. (WRB) 00214 * 920501 Reformatted the REFERENCES section. (WRB) 00215 * 070118 Reformat to LAPACK coding style 00216 * 00217 * ===================================================================== 00218 * 00219 * .. Local Scalars .. 00220 DOUBLE PRECISION DSDOT 00221 INTEGER I,KX,KY,NS 00222 * .. 00223 * .. Intrinsic Functions .. 00224 INTRINSIC DBLE 00225 * .. 00226 DSDOT = SB 00227 IF (N.LE.0) THEN 00228 SDSDOT = DSDOT 00229 RETURN 00230 END IF 00231 IF (INCX.EQ.INCY .AND. INCX.GT.0) THEN 00232 * 00233 * Code for equal and positive increments. 00234 * 00235 NS = N*INCX 00236 DO I = 1,NS,INCX 00237 DSDOT = DSDOT + DBLE(SX(I))*DBLE(SY(I)) 00238 END DO 00239 ELSE 00240 * 00241 * Code for unequal or nonpositive increments. 00242 * 00243 KX = 1 00244 KY = 1 00245 IF (INCX.LT.0) KX = 1 + (1-N)*INCX 00246 IF (INCY.LT.0) KY = 1 + (1-N)*INCY 00247 DO I = 1,N 00248 DSDOT = DSDOT + DBLE(SX(KX))*DBLE(SY(KY)) 00249 KX = KX + INCX 00250 KY = KY + INCY 00251 END DO 00252 END IF 00253 SDSDOT = DSDOT 00254 RETURN 00255 END