[ Thread 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:35:12 +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 :content-transfer-encoding; bh=lz9E6xeBA3LK5dWAv+AwqF7bEr0k4syH3f0582jnbpQ=; b=o6iZqZdiLadbS1h58T3WGSMdIOrRsug1D7PFv/0CMX5ALniOYdswMoGfr7Nv7QvB7v 5gNvha5tQieseUkOGv0nVIt5rgynFM+TKGN3mf0wVuIweVP6kYKW0pb5xgMQyYp5dwBD qWgSwS55CGKt+rVYTryOL1/RO0pdCz4Oy5AI0=
- 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=Fr/KcAR6Rob+6mOB2kHNJ8oUvplWVDLBVK/GtfY2u8eyKtvXM+A/5ZMVZuavUgsRvK ThzvfWwGRgZGA/OOXpsJN4xZ7dqVxD2IT6nq8+dIys50bNZmdYx+p3la96wQYe2eEwyV Y2FupnAkUslLovki+WsblozASewe4cEKMy1Ew=
On Mon, Jun 28, 2010 at 8:30 PM, Benoit Jacob <jacob.benoit.1@xxxxxxxxx> wrote:
But I've never seen A^-1 B used when A isn't injective. In that
> case, one says in plain text "let X be a solution of AX=B". There is
> no way to write that as a formula.
yes that's very true...
> So I see your point in the invertible case, but I feel that there is a
> problem in the non-invertible case. Since invertibility is a numerical
> issue, I agree not to let it impact the API. But at least, non-square
> matrices should be banned.
> How about this proposal:
> - call it solver() in the general case
> - add inverse() as another method that checks that the matrix is
> square, and returns solver().
> Of course, in all decompositions that are restricted to square
> matrices, no need for solver(), so this amounts to just your proposal:
my problem is that I really want a uniform API from diagonal matrix to
SVD, including triangular and permutation. So for uniformity we should
also add solver() (or pseudoInverse() or whatever) to
DiagonalMatrixBase, to Permutation, etc... Having both everywhere
makes no sense, they would always return the same thing, the only
difference being that for QR and SVD inverse() would trigger an assert
if the matrix is not square.
Is it so bad to have: SVD::inverse() actually returns a pseudo-inverse
with big warnings in the documentation ?
We could also have a pseudoInverse() alias for QR and SVD, but keeping
inverse() valid for rectangular matrix.