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

SSCAL

Purpose:
    scales a vector by a constant.
    uses unrolled loops for increment equal to 1.
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 3/93 to return if incx .le. 0.
     modified 12/3/93, array(1) declarations changed to array(*)

Definition at line 55 of file sscal.f.

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