Annotation of researchv10no/cmd/view2d/num/saxpy.f, revision 1.1

1.1     ! root        1:       subroutine saxpy(n,sa,sx,incx,sy,incy)
        !             2: c
        !             3: c     constant times a vector plus a vector.
        !             4: c     uses unrolled loop for increments equal to one.
        !             5: c     jack dongarra, linpack, 3/11/78.
        !             6: c
        !             7:       real sx(1),sy(1),sa
        !             8:       integer i,incx,incy,ix,iy,m,mp1,n
        !             9: c
        !            10:       if(n.le.0)return
        !            11:       if (sa .eq. 0.0) return
        !            12:       if(incx.eq.1.and.incy.eq.1)go to 20
        !            13: c
        !            14: c        code for unequal increments or equal increments
        !            15: c          not equal to 1
        !            16: c
        !            17:       ix = 1
        !            18:       iy = 1
        !            19:       if(incx.lt.0)ix = (-n+1)*incx + 1
        !            20:       if(incy.lt.0)iy = (-n+1)*incy + 1
        !            21:       do 10 i = 1,n
        !            22:         sy(iy) = sy(iy) + sa*sx(ix)
        !            23:         ix = ix + incx
        !            24:         iy = iy + incy
        !            25:    10 continue
        !            26:       return
        !            27: c
        !            28: c        code for both increments equal to 1
        !            29: c
        !            30: c
        !            31: c        clean-up loop
        !            32: c
        !            33:    20 m = mod(n,4)
        !            34:       if( m .eq. 0 ) go to 40
        !            35:       do 30 i = 1,m
        !            36:         sy(i) = sy(i) + sa*sx(i)
        !            37:    30 continue
        !            38:       if( n .lt. 4 ) return
        !            39:    40 mp1 = m + 1
        !            40:       do 50 i = mp1,n,4
        !            41:         sy(i) = sy(i) + sa*sx(i)
        !            42:         sy(i + 1) = sy(i + 1) + sa*sx(i + 1)
        !            43:         sy(i + 2) = sy(i + 2) + sa*sx(i + 2)
        !            44:         sy(i + 3) = sy(i + 3) + sa*sx(i + 3)
        !            45:    50 continue
        !            46:       return
        !            47:       end

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.