This is the mail archive of the
gsl-discuss@sources.redhat.com
mailing list for the GSL project.
negative strides
- To: gsl-discuss at sourceware dot cygnus dot com
- Subject: negative strides
- From: "E. Robert Tisdale" <edwin at netwood dot net>
- Date: Thu, 20 Jul 2000 02:51:23 +0000
subroutine dcopy(n,dx,incx,dy,incy)
c
c copies a vector, x, to a vector, y.
c uses unrolled loops for increments equal to one.
c jack dongarra, linpack, 3/11/78.
c modified 12/3/93, array(1) declarations changed to array(*)
c
double precision dx(*),dy(*)
integer i,incx,incy,ix,iy,m,mp1,n
c
if(n.le.0)return
c
c code for unequal increments or equal increments
c not equal to 1
c
ix = 1
iy = 1
if(incx.lt.0)ix = (-n+1)*incx + 1
if(incy.lt.0)iy = (-n+1)*incy + 1
do 10 i = 1,n
dy(iy) = dx(ix)
ix = ix + incx
iy = iy + incy
10 continue
return
The BLAS library is perfectly happy with negative strides.
Many implementations work with zero strides as well.
But the GSL vector class supports only positive strides
which means that if precludes the application program
from taking full advantage of the BLAS library.