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

QR decomposition from matlab to Eigen

Tags: None
(comma "," separated)
hesamipp
Registered Member
Posts
2
Karma
0
Hello all,

In matlab i have:

[q r]=qr( mymat , 0 ); % it's a 1024x6 --> 'q' will be the same size as 'mymat'

but in eigen, i cannot do that

Eigen::HouseholderQR<MatrixXd> qr(mymat );
MatrixXd q=qr.householderQ(); //it will be a 1024x1024
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
what you want is the "thin" Q. You can workaround with:

MatrixXd q = MatrixXd::Identity(mat.rows(), mat.cols());
q.applyOnTheLeft( qr.householderQ() );


Bookmarks



Who is online

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