How to find the permutation matrix for the qr decomposition?
7 views (last 30 days)
Show older comments
Sergey Solovev
on 30 Mar 2018
Commented: Sergey Solovev
on 30 Mar 2018
How to find the permutation matrix for the qr decomposition without using the function "[q,r,e]=qr(A)"?
0 Comments
Accepted Answer
Christine Tobler
on 30 Mar 2018
You need to compute all three matrices together: Q and R are different if the third output e is also returned.
For an algorithm, search for "qr with column pivoting" or consult Golub and Van Loan, "Matrix Computations", 3rd edition, section 5.4.1 "Rank Deficiency: QR with Column Pivoting".
As I remember, the trick is to permute the columns of A to move the column of largest norm to the left, in every step of the algorithm.
More Answers (1)
Christine Tobler
on 30 Mar 2018
I'm afraid using the three-output syntax is the only way. You can use
[~, ~, p] = qr(A);
but Q and R are still computed, just not returned. Could you tell us some more about why you need the permutation matrix only?
3 Comments
John D'Errico
on 30 Mar 2018
So you know how to compute a basic QR, but are not sure how the pivoting was done inside QR?
See Also
Categories
Find more on Linear Algebra in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!