Re: [eigen] eigen blas/lapack + suitesparse |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] eigen blas/lapack + suitesparse
- From: Gael Guennebaud <gael.guennebaud@xxxxxxxxx>
- Date: Fri, 17 Jun 2011 21:25:21 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-type:content-transfer-encoding; bh=v787s6Gf1TK328F3+kw2mC3lRwENNNmXv1sK9dRS/r8=; b=jUqliFoXQdNEoqX6BzXOV8G0bjkhThutkZqoxyp6Qavavvc4E2XZxucSezWq/gnsQ/ i/P4Ug+t6q1j8NDVI9Vge0vwiuLLYrAlqzzLxfynFb81UDFtqJHgR69rN8Ji5ZRJ12X/ fPBdG0O4TwLwuPgxYo00nq7FEkDPU5lnj+b/U=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=rcNc3meJ0yLYHwjDw0+BqDAWZlJb6qari7pCCbOK4c6wayJAkBmXcOEqPB3eC0wbXJ am2ege9Za9kbAwNbUiK2aMMNFux6Mxdc56LBoA1m3zkE9I/8SAdBQ3edIPCRQDIg1BI+ eivN55kU1zGg2MLCwaPjicKc7rDgz7MRrxYyM=
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
>
>
>