[eigen] SVD class has been removed |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen <eigen@xxxxxxxxxxxxxxxxxxx>
- Subject: [eigen] SVD class has been removed
- From: Benoit Jacob <jacob.benoit.1@xxxxxxxxx>
- Date: Tue, 12 Oct 2010 10:38:49 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=9EWTIJmWAcgERVQWsiM+ubOsuUjFPcamjPmNsvuDiNo=; b=IaCyInlCVwfTXmxNm5wFfHG1QxtqmwMCjxygKIrThe0Vnh4/RSvyaAARulneTq3+zU No5VgtkIKqRKyqgZ2a5HIQTHVwQVj07C/eyzdXhHJkdAom9hYN/co1sqc7prK49LcZnN DX6SaR9Yoqqp7yJenOMMuPK5FS/Qdndd8qSCw=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=rTTY5pAnn/l6Bauv1zM3NMSuWQ+XFmXLgWMT7VjjCNfq3rG4UkCkY4ByJP8W4QgBeJ jl6KI4ckKUF0yV9MYx0ehHPhsoHXY1JxzSX+9cva6/ZnmoyRSDkb7A6ltBxIPDIUSeCG 40zoQz67BHhCrH3FMe38Bz6Bkzhpbt1wnkQbw=
Hi,
The SVD class has just been removed, use JacobiSVD instead for now.
*** What happened ***
Remember that this was code borrowed from elsewhere, intended as a
temporary solution; recent bug reports showed that getting rid of it
was a bigger emergency than expected:
http://eigen.tuxfamily.org/bz/show_bug.cgi?id=21
http://eigen.tuxfamily.org/bz/show_bug.cgi?id=22
These bugs were specific to our implementation, they were not part of
what I mean when I say that bidiagonal SVD is inherently not as
safe/accurate as JacobiSVD.
But it remains true that JacobiSVD is safer and more accurate than any
bidiagonal SVD. Especially as our JacobiSVD is two-sided.
*** How to adapt your code ***
JacobiSVD is not a drop-in replacement for SVD, the API is a bit different.
The biggest difference is that you have to explicitly ask for U or V
if you want them. By default, none is computed.
The other difference is that you have the option of getting thin U /
V, which is faster.
If you want full U and V:
JacobiSVD<MatrixType> svd(matrix, ComputeFullU | ComputeFullV);
If you want thin U and V (faster, and all you need for solving):
JacobiSVD<MatrixType> svd(matrix, ComputeThinU | ComputeThinV);
If you want only thin U and no V:
JacobiSVD<MatrixType> svd(matrix, ComputeThinU);
Also note that JacobiSVD uses the R-SVD approach: given a rectangular
matrix, first do a QR to reduce it to a square matrix. You can control
the choice of QR algorithm. By default it's column-pivoting. If you
want no pivoting (faster, less safe, comparable safety to the
bidiagonalization process, but the subsequent Jacobi iteration is
still safer than its counterpart), do:
JacobiSVD<MatrixType, HouseholderQRPreconditioner> svd(matrix, ComputeThinU);
Benoit