[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] SVD Bug
- From: Benoit Jacob <jacob.benoit.1@xxxxxxxxx>
- Date: Fri, 24 Sep 2010 10:52:44 -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; bh=PSGBcAljw/8caUoUqrk3+qVQS+4vaCzsD+DBu4/8eJI=; b=HsPs2aEzl4AUUyfPcFNzNQ5jzRC2H8AOIYyrAkFem/9DTeXCuFfzIXaRj0jLWVL2gD cvZucG8VfhDIwQU5p6q0AAHfIk6oGA5UGVQbaeigvWjHkxL5/Bk0AptiQaeP5myli5sx pt+Ix/ShXYcJvaXiEWsN/M1uoxF09AQjoUsoM=
- 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; b=EUFNeiYHwFRkUg5OHTsODT4rr4DcJ5393N3dkWTlqGZSCn75ml5QPRAGzePy43X1Cx aHJPDVEI1aC/OGFGnNykstnmYvpIEheilry4YDuQp+mGLMDP5VF582x80x/JEtpztmQ0 J+fmQUsul8zVDtACvx7X8nfivQXQhtS85VgkE=
2010/9/24 Benoit Jacob <jacob.benoit.1@xxxxxxxxx>:
> 2010/9/24 Hauke Heibel <hauke.heibel@xxxxxxxxxxxxxx>:
>> I added Gram Schmidt orthogonalization and I added Helmut's proposal
>> to use the normal equations to evaluate least squares solutions.
>>
>> Again, a little check would be great!
> Excellent. Since you check with VERIFY_IS_UNITARY, you have proof that
> your Gram-Schmidt code is correct.
Ah wait! You do have one reliability issue. Here, at column i, you
start with the i-th vector of the standard basis (0,...,0,1,0,..,0
with the 1 at the i-th position). This will fail (or be numerically
instable) if this vector happens to be in the linear span of the
previous columns (or approximately in the linear span). So you have to
nest another loop here: at every col, try all vectors in the standard
basis until the norm of the projection is big enough. I am pretty sure
that big enough means that the norm be >= 1/sqrt(n) since in the 2D
case, clearly you can get 1/sqrt(2). So check that the squared norm is
1/n. Might want to say 1/(2*n) to be a little tolerant, since in case
it's exactly 1/n, some FP imprecision could play tricks.
Benoit
>
> Also, good idea, to use the normal equations. Allows the test to be
> more general since now you're testing arbitrary RHS.
>
>>
>> Unit tests svd_1 to svd_4 do all pass but svd_9 fails. It seems as if
>> it gets stuck, no error message, no nothing. What is this test for? It
>> seems a bit strange.
>
> It's broken, please remove it. It seems to be trying to check that the
> svd constructor checks that rows>=cols. But in order to do that, it
> would have to use VERIFY_RAISES_ASSERT. And frankly, i wouldn't put
> that right into the CALL_SUBTEST, I would put that in a function and
> call that from CALL_SUBTEST. But don't bother if you don't have time,
> it's OK to remove that.
>
> Benoit
>
>>
>> - Hauke
>>
>