This forum has been archived. All content is frozen. Please use KDE Discuss instead.

getting NaN's using jacobi svd

Tags: None
(comma "," separated)
rafiwitten
Registered Member
Posts
1
Karma
0
OS

getting NaN's using jacobi svd

Wed May 09, 2012 5:46 am
running the following code snipped on a MatrixXd A produces a matrix U that has NaN's in it.

Code: Select all
Eigen::JacobiSVD< MatrixXd> svd = A.jacobiSvd(Eigen::ComputeThinU | Eigen::ComputeThinV);
Eigen::MatrixXd U = svd.matrixU();
Eigen::MatrixXd V = svd.matrixV();
Eigen::VectorXd S = svd.singularValues();


I'm curious (1) how is that possible and (2) how can I avoid it? This part of my application is not performance critical at all, so I'd be happy to use a different SVD algorithm if (for example) Jacobi simply sometimes runs into numerical issues.

Thanks,
Rafi
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS

Re: getting NaN's using jacobi svd

Mon May 14, 2012 4:22 pm
This is probably due to overflow issues, perhaps you could apply a scaling prior to factorization. We already had such a discussion in this forum a few month ago.


Bookmarks



Who is online

Registered users: Bing [Bot], claydoh, Google [Bot], rblackwell, Yahoo [Bot]