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

[SOLVED] How to use SVD in eigen

Tags: None
(comma "," separated)
ColdFace
Registered Member
Posts
2
Karma
0

[SOLVED] How to use SVD in eigen

Sat Mar 28, 2009 7:08 pm
Hey

I am trying to learn how to use the SVD module in Eigen.

The below code is from the small tutorial on the website that I am starting with. I need to get access to the three Matrices U, S, and V so I can manipulate them for LSA. I am having difficulty in understanding how the SVD module works and how I can use it.

Any suggestions

Thanks


Code: Select all
#include
#include

// import most common Eigen types
USING_PART_OF_NAMESPACE_EIGEN

int main(int, char *[])
{
  Matrix3f m3;
  m3 > x;
}
swx
Registered Member
Posts
9
Karma
0

[SOLVED] How to use SVD in eigen

Sun Mar 29, 2009 3:45 pm
Haven't actually used the SVD in Eigen for anything, but this seems to work:
Code: Select all
Eigen::Matrix3f m3;
m3  svd(m3);

const Eigen::Matrix3f U = svd.matrixU();
const Eigen::Matrix3f V = svd.matrixV();
const Eigen::VectorXf S = svd.singularValues();
ColdFace
Registered Member
Posts
2
Karma
0

[SOLVED] How to use SVD in eigen

Sun Mar 29, 2009 4:01 pm
Thank you very much. It works great.

I had tried code very simliar to what you wrote but I had not created the third line of the code correctly. I feel dumb now. I will go back to my cave and cry :-$

Thanks


Bookmarks



Who is online

Registered users: Bing [Bot], Evergrowing, Google [Bot], rblackwell