LAPACK  3.6.1
LAPACK: Linear Algebra PACKage
subroutine daxpy ( integer  N,
double precision  DA,
double precision, dimension(*)  DX,
integer  INCX,
double precision, dimension(*)  DY,
integer  INCY 
)

DAXPY

Purpose:
    DAXPY constant times a vector plus a vector.
    uses unrolled loops for increments equal to one.
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Date
November 2011
Further Details:
     jack dongarra, linpack, 3/11/78.
     modified 12/3/93, array(1) declarations changed to array(*)

Definition at line 54 of file daxpy.f.

54 *
55 * -- Reference BLAS level1 routine (version 3.4.0) --
56 * -- Reference BLAS is a software package provided by Univ. of Tennessee, --
57 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
58 * November 2011
59 *
60 * .. Scalar Arguments ..
61  DOUBLE PRECISION da
62  INTEGER incx,incy,n
63 * ..
64 * .. Array Arguments ..
65  DOUBLE PRECISION dx(*),dy(*)
66 * ..
67 *
68 * =====================================================================
69 *
70 * .. Local Scalars ..
71  INTEGER i,ix,iy,m,mp1
72 * ..
73 * .. Intrinsic Functions ..
74  INTRINSIC mod
75 * ..
76  IF (n.LE.0) RETURN
77  IF (da.EQ.0.0d0) RETURN
78  IF (incx.EQ.1 .AND. incy.EQ.1) THEN
79 *
80 * code for both increments equal to 1
81 *
82 *
83 * clean-up loop
84 *
85  m = mod(n,4)
86  IF (m.NE.0) THEN
87  DO i = 1,m
88  dy(i) = dy(i) + da*dx(i)
89  END DO
90  END IF
91  IF (n.LT.4) RETURN
92  mp1 = m + 1
93  DO i = mp1,n,4
94  dy(i) = dy(i) + da*dx(i)
95  dy(i+1) = dy(i+1) + da*dx(i+1)
96  dy(i+2) = dy(i+2) + da*dx(i+2)
97  dy(i+3) = dy(i+3) + da*dx(i+3)
98  END DO
99  ELSE
100 *
101 * code for unequal increments or equal increments
102 * not equal to 1
103 *
104  ix = 1
105  iy = 1
106  IF (incx.LT.0) ix = (-n+1)*incx + 1
107  IF (incy.LT.0) iy = (-n+1)*incy + 1
108  DO i = 1,n
109  dy(iy) = dy(iy) + da*dx(ix)
110  ix = ix + incx
111  iy = iy + incy
112  END DO
113  END IF
114  RETURN