| 11339 | } /* scopy_ */ |
| 11340 | |
| 11341 | doublereal sdot_(integer *n, real *sx, integer *incx, real *sy, integer *incy) |
| 11342 | { |
| 11343 | /* System generated locals */ |
| 11344 | integer i__1; |
| 11345 | real ret_val; |
| 11346 | |
| 11347 | /* Local variables */ |
| 11348 | static integer i__, m, ix, iy, mp1; |
| 11349 | static real stemp; |
| 11350 | |
| 11351 | |
| 11352 | /* |
| 11353 | Purpose |
| 11354 | ======= |
| 11355 | |
| 11356 | SDOT forms the dot product of two vectors. |
| 11357 | uses unrolled loops for increments equal to one. |
| 11358 | |
| 11359 | Further Details |
| 11360 | =============== |
| 11361 | |
| 11362 | jack dongarra, linpack, 3/11/78. |
| 11363 | modified 12/3/93, array(1) declarations changed to array(*) |
| 11364 | |
| 11365 | ===================================================================== |
| 11366 | */ |
| 11367 | |
| 11368 | /* Parameter adjustments */ |
| 11369 | --sy; |
| 11370 | --sx; |
| 11371 | |
| 11372 | /* Function Body */ |
| 11373 | stemp = 0.f; |
| 11374 | ret_val = 0.f; |
| 11375 | if (*n <= 0) { |
| 11376 | return ret_val; |
| 11377 | } |
| 11378 | if (*incx == 1 && *incy == 1) { |
| 11379 | goto L20; |
| 11380 | } |
| 11381 | |
| 11382 | /* |
| 11383 | code for unequal increments or equal increments |
| 11384 | not equal to 1 |
| 11385 | */ |
| 11386 | |
| 11387 | ix = 1; |
| 11388 | iy = 1; |
| 11389 | if (*incx < 0) { |
| 11390 | ix = (-(*n) + 1) * *incx + 1; |
| 11391 | } |
| 11392 | if (*incy < 0) { |
| 11393 | iy = (-(*n) + 1) * *incy + 1; |
| 11394 | } |
| 11395 | i__1 = *n; |
| 11396 | for (i__ = 1; i__ <= i__1; ++i__) { |
| 11397 | stemp += sx[ix] * sy[iy]; |
| 11398 | ix += *incx; |