[eigen] SVD class has been removed

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


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



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/