Re: [eigen] eigen blas/lapack + suitesparse

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


yes it does handle negative increments, and I don't see what's wrong
here. Recall that with blas, a negative increment means to loop
through the vector from the last to the first element. The pointer
always refers to the first element.

gael

On Fri, Jun 17, 2011 at 9:10 PM, Rhys Ulerich <rhys.ulerich@xxxxxxxxx> wrote:
> On Fri, Jun 17, 2011 at 12:52 PM, Gael Guennebaud
> <gael.guennebaud@xxxxxxxxx> wrote:
>> yes, it is complete enough for all direct solver libraries that I've
>> tried.
>
> Was the Eigen BLAS intended to handle negative strides?  I've noticed
> code like the following where incx < 0 looks like it behaves
> incorrectly:
>
> int EIGEN_BLAS_FUNC(scal)(int *n, RealScalar *palpha, RealScalar *px, int *incx)
> {
>  if(*n<=0) return 0;
>
>  Scalar* x = reinterpret_cast<Scalar*>(px);
>  Scalar alpha = *reinterpret_cast<Scalar*>(palpha);
>
>  if(*incx==1)  vector(x,*n) *= alpha;
>  else          vector(x,*n,std::abs(*incx)) *= alpha;
>
>  return 0;
> }
>
> Has anyone run into such a problem in practice?
>
> - Rhys
>
>
>



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/