LAPACK  3.6.1 LAPACK: Linear Algebra PACKage
 subroutine saxpy ( integer N, real SA, real, dimension(*) SX, integer INCX, real, dimension(*) SY, integer INCY )

SAXPY

Purpose:
```    SAXPY constant times a vector plus a vector.
uses unrolled loops for increments equal to one.```
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 saxpy.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  REAL sa
62  INTEGER incx,incy,n
63 * ..
64 * .. Array Arguments ..
65  REAL sx(*),sy(*)
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 (sa.EQ.0.0) 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  sy(i) = sy(i) + sa*sx(i)
89  END DO
90  END IF
91  IF (n.LT.4) RETURN
92  mp1 = m + 1
93  DO i = mp1,n,4
94  sy(i) = sy(i) + sa*sx(i)
95  sy(i+1) = sy(i+1) + sa*sx(i+1)
96  sy(i+2) = sy(i+2) + sa*sx(i+2)
97  sy(i+3) = sy(i+3) + sa*sx(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  sy(iy) = sy(iy) + sa*sx(ix)
110  ix = ix + incx
111  iy = iy + incy
112  END DO
113  END IF
114  RETURN