[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] solve API
- From: Benoit Jacob <jacob.benoit.1@xxxxxxxxx>
- Date: Mon, 28 Jun 2010 16:43:49 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=qIovm0MaKNep+vrrFELOFe5TXTs56eLUGqdrpL5N0w0=; b=FGQZehyu7zJqZZAJvQRUyzIarQOATntuIna8OLVbkfWH4swBny0C9Mzj6hRz6CSDOU 9nQTI/nI4Z4TKOFGDPAO3Ov1I019MxzE6G0GHufKjiiL7VxDIZSry76Rb3aAtF37gFNb Yz2LVQtYV3+uPCguisU/0wpt3UYqwlBaCKOZg=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=ZnBeZp23qy9bhIweujK+fQtU0woL/tOSjLn0ymyPn7l7zKfW9nkp7n2k62OayGhpzT Q+RFva2CSPTSCLNQuBajjmqg3142n+yloplno+KC8+a0GU9/gZpmzVVjk+Usw+0rNogz yHhNg0IVHGBrB2FS6Tjo26JHO29tpK46LnQHk=
2010/6/28 Gael Guennebaud <gael.guennebaud@xxxxxxxxx>:
> 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:
>> inverse().
>
> 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.
It's OK, I can live with that. Provided that it's crystal clear that
the current imperative solve() API remains available (and not
deprecated).
Benoit
>
> gael
>
>>
>> Benoit
>>
>
>
>