Re: [eigen] solve API |

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

*To*: eigen@xxxxxxxxxxxxxxxxxxx*Subject*: Re: [eigen] solve API*From*: Gael Guennebaud <gael.guennebaud@xxxxxxxxx>*Date*: Mon, 28 Jun 2010 22:48:34 +0200*Dkim-signature*: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:content-type; bh=D8hvLQUW1geV3utCK6fiQkSi0QQStVzsjohM6aAL/no=; b=c9rk/i0vB6KUuE//8RdkR2DASsfyYHd0WykPuuyYS3OTXW3kvV965ytUWRTfBVKMJr PRvdx13GN6TY4eEv86ZpblK44xAUJqUJj1uJQ6XuRTnbyINacPWR475DQqnQrbS8s0mJ L/7HzFxZIiwMCr4Lmgp6cwXC1MpJZwyUks/gk=*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; b=pooikYOfVxfmh+uT5Ldk7UF65vn2YFCroVbX5tm67Ifeo7sF5ppHyjGnpA7gkGiXeB 76gIOfOe8VaPYd+agUrNbDCsM58oSxqeWNOaIsQ8DTJrg5q8mQ1C4Vsztwm+VfMQqiE5 xZCWy745iMaFMp/JvPoB8vjqrsrIrS3pNVxMM=

On Mon, Jun 28, 2010 at 9:23 PM, Hauke Heibel <hauke.heibel@xxxxxxxxxxxxxx> wrote: > On Mon, Jun 28, 2010 at 3:19 PM, Gael Guennebaud > <gael.guennebaud@xxxxxxxxx> wrote: >> I really prefer inverse() because ... > > I agree with Gael, I also prefer inverse(). Not only because it is > generic but also because > > x = A.lu().solver() * b > > looks a bit strange and would require template arguments for > transposition and adjoint flags. > >> For rectangular matrices, inverse still make sense as the pseudo >> inverse. The weird thing is that the returned Inverse expression would >> become the left pseudo inverse or right pseudo inverse at the moment >> it is applied to a matrix: >> >> Matrix m(r,c); >> >> x = m.svd().inverse() * m; // left pseudo inverse, x = identity(c,c); >> x = m * m.svd().inverse(); // right pseudo inverse, x = identity(r,r); > > This is too bad because I just wanted to propose > > x = A.svd().pinv() * b > > or > > x = A.svd().pseudoinverse() * b > > By the way, thinking once again about your argument regarding generic > algorithms, I am not sure anymore whether I would totally agree. QR > and SVD for instance might be offering a unified ::pseudoinverse() > function (well, in that direction) because in fact, whenever the > matrix is not invertible, this is what the method return. Well, I hope > I am right with that. :) On the other hand side, we could simply agree > on the common understanding that inverse() might potentially be > returning/computing the pseudo inverse. yeah ! someone on my side :) > >> meaning that: >> >> mat = svd.inverse(); >> >> would be undefined (illegal), but I think that's fine. > > So, you mean > > mat = A.svd().inverse() > > but what you say should only be true if A is not square. When A is > square, that should be possible and as I mentioned before it were > holding for QR too. ah yes that's true. gael > > - Hauke > > >

**Follow-Ups**:**Re: [eigen] solve API***From:*Manoj Rajagopalan

**References**:**[eigen] solve API***From:*Gael Guennebaud

**Re: [eigen] solve API***From:*Benoit Jacob

**Re: [eigen] solve API***From:*Gael Guennebaud

**Re: [eigen] solve API***From:*Hauke Heibel

**Messages sorted by:**[ date | thread ]- Prev by Date:
**Re: [eigen] solve API** - Next by Date:
**Re: [eigen] can't reproduce gcc 4.3.4 errors** - Previous by thread:
**Re: [eigen] solve API** - Next by thread:
**Re: [eigen] solve API**

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