[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-gsl] blas rotm index computation

From: Brian Gough
Subject: Re: [Help-gsl] blas rotm index computation
Date: Fri, 01 May 2009 12:30:26 +0200
User-agent: Wanderlust/2.14.0 (Africa) Emacs/22.1 Mule/5.0 (SAKAKI)

At Fri,  1 May 2009 09:46:51 +0200,
Marco Maggi wrote:
> so when the vector stride is negative the elements
> of the vector are iterated starting from index:
> i = (X->size - 1) * -(X->stride);
> which equals:
> i = (X->size - 1) * abs(X->stride);

According the the original BLAS standards, a negative stride (inc)
accesses the elements backwards, i.e.  incX=-1 accesses the vector as

X->data[(N-1)],  X->data[(N-2)], ...., X->data[0].

and incX=-2 as 

X->data[2*(N-1)],  X->data[2*(N-2)], ...., X->data[0].

Positive and negative inc values can be used together, the result is
of the form \sigma_i x_i y_(N-i) in a dot product for example.

Only the cblas functions support -ve stride, the gsl_vectors always
have +ve strides so this doesn't affect anything involving gsl_vector.

> Notice that the test suite in "cblas/test_rotm.c"
> tests vectors of size==1, so this problem does not
> show itself.

Hmm, yes, it would be good to extend that.

Brian Gough

reply via email to

[Prev in Thread] Current Thread [Next in Thread]