source: trunk/SOURCES/BLAS/sscal.f @ 23

Last change on this file since 23 was 4, checked in by dumas, 10 years ago

initial import GRISLI trunk

File size: 1000 bytes
Line 
1      subroutine sscal(n,sa,sx,incx)
2c
3c     scales a vector by a constant.
4c     uses unrolled loops for increment equal to 1.
5c     jack dongarra, linpack, 3/11/78.
6c     modified 3/93 to return if incx .le. 0.
7c     modified 12/3/93, array(1) declarations changed to array(*)
8c
9      real sa,sx(*)
10      integer i,incx,m,mp1,n,nincx
11c
12      if( n.le.0 .or. incx.le.0 )return
13      if(incx.eq.1)go to 20
14c
15c        code for increment not equal to 1
16c
17      nincx = n*incx
18      do 10 i = 1,nincx,incx
19        sx(i) = sa*sx(i)
20   10 continue
21      return
22c
23c        code for increment equal to 1
24c
25c
26c        clean-up loop
27c
28   20 m = mod(n,5)
29      if( m .eq. 0 ) go to 40
30      do 30 i = 1,m
31        sx(i) = sa*sx(i)
32   30 continue
33      if( n .lt. 5 ) return
34   40 mp1 = m + 1
35      do 50 i = mp1,n,5
36        sx(i) = sa*sx(i)
37        sx(i + 1) = sa*sx(i + 1)
38        sx(i + 2) = sa*sx(i + 2)
39        sx(i + 3) = sa*sx(i + 3)
40        sx(i + 4) = sa*sx(i + 4)
41   50 continue
42      return
43      end
Note: See TracBrowser for help on using the repository browser.