| 388 | /******************************************************************************/ |
| 389 | |
| 390 | double ddot ( int n, double dx[], int incx, double dy[], int incy ) |
| 391 | |
| 392 | /******************************************************************************/ |
| 393 | /* |
| 394 | Purpose: |
| 395 | |
| 396 | DDOT forms the dot product of two vectors. |
| 397 | |
| 398 | Discussion: |
| 399 | |
| 400 | This routine uses unrolled loops for increments equal to one. |
| 401 | |
| 402 | Modified: |
| 403 | |
| 404 | 30 March 2007 |
| 405 | |
| 406 | Author: |
| 407 | |
| 408 | FORTRAN77 original by Jack Dongarra, Cleve Moler, Jim Bunch, Pete Stewart. |
| 409 | C version by John Burkardt |
| 410 | |
| 411 | Reference: |
| 412 | |
| 413 | Jack Dongarra, Cleve Moler, Jim Bunch, Pete Stewart, |
| 414 | LINPACK User's Guide, |
| 415 | SIAM, 1979. |
| 416 | |
| 417 | Charles Lawson, Richard Hanson, David Kincaid, Fred Krogh, |
| 418 | Basic Linear Algebra Subprograms for Fortran Usage, |
| 419 | Algorithm 539, |
| 420 | ACM Transactions on Mathematical Software, |
| 421 | Volume 5, Number 3, September 1979, pages 308-323. |
| 422 | |
| 423 | Parameters: |
| 424 | |
| 425 | Input, int N, the number of entries in the vectors. |
| 426 | |
| 427 | Input, double DX[*], the first vector. |
| 428 | |
| 429 | Input, int INCX, the increment between successive entries in DX. |
| 430 | |
| 431 | Input, double DY[*], the second vector. |
| 432 | |
| 433 | Input, int INCY, the increment between successive entries in DY. |
| 434 | |
| 435 | Output, double DDOT, the sum of the product of the corresponding |
| 436 | entries of DX and DY. |
| 437 | */ |
| 438 | { |
| 439 | double dtemp; |
| 440 | int i; |
| 441 | int ix; |
| 442 | int iy; |
| 443 | int m; |
| 444 | |
| 445 | dtemp = 0.0; |
| 446 | |
| 447 | if ( n <= 0 ) |