Re: [eigen] Positive Definitenes? |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] Positive Definitenes?
- From: Benoit Jacob <jacob.benoit.1@xxxxxxxxx>
- Date: Thu, 4 Mar 2010 11:17:19 -0500
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=iAIy0GOkU+DjHH+nO8reRtj162gp5aaxcMAMDVy7lyk=; b=IRgfl7899Pg4OQXNCgasLrYCPKGkJcefAtmoeDUN6/KQ2MQ2148aQkphz8nJv3Jgrv 2MO1P1qWfO+qJmVP+6uO7LZ5vPhRloYKQVDQQvJlbO/VbXzrW8OIDJXMzEosp8mhoGKa K3wVmftf0iwuxVLLgpvOfGhM9M4GN9UGt9DPw=
- 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=MTORUKmSXFfkn2n1vC692voP1lUQU194yczjW3d/SBuSy+n1dvsFb5UMrAp5XsEOyq BoRw0fh/866H8QzZ9nU/UZtbCBHQNN8hNc1Zm7IebtC3j1h2svMpVyb7h4dkiWFgnYLo 9K3H73/eRqZFVIw9R1Y/+BzZUKccMkNYq0NSM=
2010/3/4 Gabriel <gabrielvc@xxxxxxxxx>:
> Thanks for your answers, I will check the approaches to check for
> efficiency. This operation would have to be done several times, and I do
> need to solve a matrix equation K x = b, with K the matrix, and b a known
> vector, and this is done a lot of times.
>
> Is there an error handler implemented? In my code this operation is
> performed hundreds of times and I would need to automatize some sort of
> workaround when the matrix is not positive definite. This would signal an
> error in my code, my matrices have to bee p.d. all the time, so I would
> implement something to forget the systems in which p.d. gets "lost".
It's not all-or-nothing: if you try to feed an indefinite matrix to an
algorithm that requires definite matrices, it typically won't be able
to tell you that the matrix is indefinite, instead in many cases it
will just be very inaccurate without being able to reliably report an
error. So, to answer your question, no such error reporting is made by
Eigen, but that's because it's impossible to implement correctly.
Benoit
>
> Gabriel
>
>
>
> On Wed, Mar 3, 2010 at 6:56 AM, Benoit Jacob <jacob.benoit.1@xxxxxxxxx>
> wrote:
>>
>> 2010/3/3 Cyril Flaig <cflaig@xxxxxxxxxxx>:
>> > On 2010-03-02 19:27, Benoit Jacob wrote:
>> >> 2010/3/2 Cyril Flaig <cflaig@xxxxxxxxxxx>:
>> >>> The Cholesky decomposition works only if the matrix is positive
>> >>> definite. If the decomposition fails then eigen sets a
>> >>> m_isPositiveDefinite to false, doesn't it?
>> >>>
>> >>> Or is this deprecated and not used in the new version?
>> >>
>> >> This is deprecated indeed.
>> >
>> > As far as I know. The fastest way to determine the postive definitnes is
>> > to check the diagonal if all entries are >=0.
>>
>> This is indeed a necessary condition for positiveness.
>>
>> > If this is true then
>> > attempt a Cholesky decomposition. If it exists then the matrix is
>> > positive definite.
>>
>> The problem with this approach is that it's an all-or-nothing test
>> that one has to perform at the time of the decomposition itself.
>> Making this useful in practice would require us to let the user pass a
>> choice of a threshold at the time of the decomposition itself (so an
>> API change) and even then, that would be pretty bad as, if the user
>> passes a higher threshold, he compromises the accuracy of a subsequent
>> solve(). So this forces a compromise between the invertibility check
>> and the precision of solve().
>>
>> Benoit
>>
>> >
>> > -cyril
>> >
>> >
>>
>>
>
>
>
> --
> ==============
> = Gabriel Villalobos,
> = Candidato a Doctor en Ciencias - Física, UN
> = M.Sc. Physics, Georgia Institute of Technology
> = Físico, Universidad Nacional de Colombia
> = Tel. Oficina. (571) 3165000 - 13031
> = gvillalobosc@xxxxxxxxxxxxxx
> = Enamoradamente Casado
> ===============
> = Acuerdos Toltecas:
> = * Hacer siempre y en todo asunto nuestro mejor
> = esfuerzo,
> = * Ser impecable con la palabra
> = * No suponer
> = * No tomarse nada a título personal
> ==============
>
>
>
>