help-gsl
[Top][All Lists]
Advanced

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

Re: [Help-gsl] Why is Negative Stride in GSL not allowed?


From: Stephan Petzchen
Subject: Re: [Help-gsl] Why is Negative Stride in GSL not allowed?
Date: Mon, 19 Nov 2012 11:52:53 +0100

But there is no such code in ATLAS. I did look up
It is not only taking the absolut value of incX also the reference starting
point should be the end of the vector.


In all there testcases they set the incX value to absolute (i.e.  Mabs(
INCX )), which simply follow the rule in one of your former messages: *(X +
abs(incX)*i) which is not considering the BLAS standard with starting point
at the end of the vector: X(1 + (n-i) * abs(INCX)).

So, my opinion now is: they do not comply with the BLAS standard document
for negative stride.

I hope you or someone other can show me that I am wrong. PLEASE...   ;-)


best

stephan

On Mon, Nov 19, 2012 at 11:18 AM, Michael Lehn <address@hidden>wrote:

>
> > I think my understanding of negative stride is as follows and probably
> matching with yours:
> >
> >
> > BLAS Specification: http://www.netlib.org/blas/blast-forum/
> > Chapter 2.5.3: Dense and Banded BLAS
>
> Yes, great reference!
>
> >
> > INCX != 0
> > i = 1,....N
> > for INCX >0: X(1 + (i-1) * INCX)
> > for INCX <0: X(1 + (n-i) * abs(INCX))
>
> Yes, you've been faster then me, so forget about my other mail.
>
>
> >
> > so for example:
> >
> > X: {1.0  2.0  3.0  4.0  5.0  6.0  7.0  8.0  9.0  10.0}
> > n =  elements to be processed = 4
> > INCX = -2
> > i = 2
> >
> > X(1 + (4-2) * abs(-2)) = X(6) = 6.0
> >
> >
> >
> > But when I look up the ATLAS source for example for computing: the sum
> \alpha + x^T y for the vectors x and y
> > the negative stride is not considered here. DO I oversee here something?
> >
>
> There should be code like this
>
>   if (incX<0) {
>       x -= incX*(n-1)
>   }
>
> somewhere.  This would move the data pointer to the last element of the
> vector.  The negative stride remains
> unchanged.
>
>
> Cheers,
>
> Michael
>
>
>


-- 

Gesius GmbH
Beim Strohhause 31
20097 Hamburg, Germany
Tel.    +49 (40) 6094673-10
Mobil +49 (172) 1977014
Fax   +49 (40) 6094673-99
email: address@hidden <address@hidden>
www.gesius.de <http://gesius.de>

gesius. engineering excellence

Sitz der Gesellschaft/Registered office: Hamburg

Handelsregister/Commercial register:  HRB 117558

Geschäftsführung/executive board: Stephan Petzchen

---
This communication contains confidential information. If you are not the
intended recipient please return this email to the sender and delete it
from your records.
Diese Nachricht enthält vertrauliche Informationen. Sollten Sie nicht der
beabsichtigte Empfänger dieser E-mail sein, senden Sie bitte diese an den
Absender zurück und löschen Sie die E-mail aus Ihrem System.


reply via email to

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