subroutine sscal (n, sa, sx, incx) c***begin prologue sscal c***purpose mULTIPLY A VECTOR BY A CONSTANT. c***library slatec (blas) c***category d1a6 c***type single precision (sscal-s, dscal-d, cscal-c) c***keywords blas, linear algebra, scale, vector c***AUTHOR Lawson, C. L., (JPL) c Hanson, R. J., (SNLA) c Kincaid, D. R., (U. of Texas) c Krogh, F. T., (JPL) c***description c c B L A S Subprogram C Description of Parameters C C --Input-- C N number of elements in input vector(s) C SA single precision scale factor C SX single precision vector with N elements C INCX storage spacing between elements of SX C C --Output-- C SX single precision result (unchanged if N .LE. 0) C C Replace single precision SX by single precision SA*SX. C For I = 0 to N-1, replace SX(1+I*INCX) with SA * SX(1+I*INCX) C c***references lawson c.l., hanson r.j., kincaid d.r., krogh f.t., c *basic linear algebra subprograms for fortran usage*, c algorithm no. 539, transactions on mathematical c software, volume 5, number 3, september 1979, 308-323 c***routines called (none) c***revision history (yymmdd) C 791001 Date written C 890831 Modified array declarations. (WRB) C 890831 REVISION DATE from Version 3.2 C 891214 Prologue converted to Version 4.0 format. (BAB) c***end prologue sscal c real sa,sx(*) c***first executable statement sscal if(n.le.0)return if(incx.eq.1)goto 20 c c code for increments not equal to 1. c ns = n*incx do 10 i = 1,ns,incx sx(i) = sa*sx(i) 10 continue return c c code for increments equal to 1. c c c clean-up loop so remaining vector length is a multiple of 5. c 20 m = mod(n,5) if( m .eq. 0 ) go to 40 do 30 i = 1,m sx(i) = sa*sx(i) 30 continue if( n .lt. 5 ) return 40 mp1 = m + 1 do 50 i = mp1,n,5 sx(i) = sa*sx(i) sx(i + 1) = sa*sx(i + 1) sx(i + 2) = sa*sx(i + 2) sx(i + 3) = sa*sx(i + 3) sx(i + 4) = sa*sx(i + 4) 50 continue return end c++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*