|Re: [eigen] Problem inverting a Matrix4f with Eigen 2.0.0|
[ Thread Index |
| More lists.tuxfamily.org/eigen Archives
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] Problem inverting a Matrix4f with Eigen 2.0.0
- From: Benoit Jacob <jacob.benoit.1@xxxxxxxxx>
- Date: Sat, 17 Jul 2010 11:01:55 -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=N6H3T0m/LmHswnrnO+DHfG7EDBAuka62Mkizj2j1YGU=; b=wWhBg1cDd9t8ayfng9JWFpdI6yzpP+lJjRyhHLkZzSmj4alRJWb4/ZaAZYAHYjXu1/ 2TSsAoY/JFxoCmJix91+IcHQl2xxY2TLo1268Q95bfTjl8lZB05yc8YZTzKA5p7AAG0s H9aK+c6cUezF++YniaD+jqDiYD6TTIqMuwgPw=
- 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=ORxXtzXm134oYaH/XuzfPY5bc7o37xZ12gMvpO/qON4xqwH8RHrY5p5butgA2YiCzq 0y0iLNN/Dkqcp1q2pEd2zgwMa29/T8OypN5zpUVwmjtxkq7PfLl76CBnRMvLr4oJDH6u CrLP0+waXXoc9PnEqXwwp44a2/Tu9wgzcgcac=
2010/7/17 Robert Lupton the Good <rhl@xxxxxxxxxxxxxxxxxxx>:
> Thanks for the quick response and analysis.
>> Your matrix is indeed not very well conditioned for floats. Are you
>> using fixed size matrices (Matrix4f) or dynamically sized ones
>> (MatrixXf) ? I'm asking because there is a special path to invert 4x4
>> fixed size matrices, and as far as I remember there was bug for some
>> special configurations in the early versions of Eigen 2.0, so I would
>> recommend you to upgrade it to the latest.
> Fixed size, Matrix4f (I thought I included that in the post; sorry). Yes, I should upgrade but that's a little inconvenient in quite a large software system. Doable, and will be done!
>> determinant != condition:
>> Matlab says the condition of your matrix is 3.8e8, which is pretty bad. (btw: is there a way to calculate condition with Eigen?)
> I know that I wanted a condition number, and quoted the determinant as I couldn't find any eigen way of finding either the condition number, or whether it thinks that the inversion succeeded.
Eigen doesn't offer any "conditionNumber()" function because there is
no such thing as the "condition number" of a matrix in general. There
are many mutually inequivalent things that are called "the condition
number of a matrix" in different contexts.
The most general notion of condition number, the only one to make
sense for all matrices, is as the quotient of the biggest singular
value over the smallest singular value.
However, in the setting of LU/LLT decomposition and inverting
matrices, this is NOT what is usually called the "condition number".
Instead, in the context of LU, one usually calls "condition number"
the quotient of the biggest absolute value of a diagonal coeff of U,
over the smallest. Thus this "condition number" doesn't have a simple
meaning in terms of the original matrix, and is only interesting to
know in the context of LU (it indicates how instable LU decomposition
is, without full pivoting).
By the way, I don't think that LAPACK offers any "condition number"
In short, it seems to be a case where it's best to let the user
compute his own "condition number" for himself, which is easy from the
decompositions, as that ensures that he understands what he's
All that being said, a condition number of 3e+8 for a float matrix
(so, bigger than 1/epsilon) really means that you shouldn't try
inverting it; it's true for both notions of condition number discussed