|Re: [eigen] Bug in SVD applied to specific matrix sizes|
[ Thread Index |
| More lists.tuxfamily.org/eigen Archives
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] Bug in SVD applied to specific matrix sizes
- From: Benoit Jacob <jacob.benoit.1@xxxxxxxxx>
- Date: Mon, 16 Mar 2009 00:13:48 +0100
- 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=0KM1NgMmywvhxo7L945By0eNizFgdLGFKnZw89lDeTc=; b=YVZy41lyonvXQOSnT3T3pKpaxFvKL38LqBsNtjf2RZ4jiW+IHeJcVrmSU9MXAaE8FS XziSdX9aNm9I2moyOtvbvACe4Sg7Zjui8NYZqgZYRUxsz5IHM1xDH+wpP5j4iwPkoPNS +UeGUWxAOJ2noendXZj7UYF2EPlLC+M92uc/0=
- 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=tCp7D97VWEouCT45vtf6eqxMH+JZcMJY4xHXkfX5HNboOv9sAj9C931WBE0+HdXHYf rcZxyBr8OYWepUDrljf9Bj3nvey8KK2U6wa94+IXrLRx3TAcJmXmDeuHYtor0+jYsDo0 YaZ1WGHj6ogw7KMkcrhpXtLtU3aNHDfsWCypc=
The current SVD code, taken from JAMA, is known to have many issues.
It's on our TODO to rewrite the SVD completely. Although i've been
completely inactive in the past 6 weeks, I really still want to do
this for Eigen 2.1, that is, very soon.
So in the meanwhile I hope it's OK for you that we consider that it's
not worth trying to fix the old code... and I hope you can find a
short term solution that works for you.
2009/3/15 Jens Andersen <jens.andersen@xxxxxxxxx>:
> I have stumbled upon a bug in SVD when applying it to certain matrix sizes.
> The particular problem occured when doing a simple four-point Direct
> Linear Transform in reduced form, providing a matrix of size 8x9.
> In this case an attempt to set a value to an index out of bounds, in
> the array m_sigma.
> The particular code is shown here:
> // Set up the final bidiagonal matrix or order p.
> int p = std::min(n,m+1);
> if (nct < n)
> m_sigma[nct] = matA(nct,nct);
> if (m < p)
> m_sigma[p-1] = 0.0;
> m_sigma has size m, whereas p is set to n=m+1. In this particular case
> m_sigma will be set, but m_sigma's highest index is 7.
> A quick test shows that this will consistently happen whenever the
> number of columns is greater than the number of rows.
> Unfortunately I don't know enough of Eigen's internal to create a
> reasonable fix.
> Jens Andersen