How to find the permutation matrix for the qr decomposition?

How to find the permutation matrix for the qr decomposition without using the function "[q,r,e]=qr(A)"?

 채택된 답변

Christine Tobler
Christine Tobler 2018년 3월 30일

2 개 추천

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.

추가 답변 (1개)

Christine Tobler
Christine Tobler 2018년 3월 30일
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

To solve an equation of type Ax=B, when A[2x7], B[2x1]. I know that equation can be solved with "mldivid" functions, but I need to know how it calculates. I know how to calculate Q and R matrix.
So you know how to compute a basic QR, but are not sure how the pivoting was done inside QR?
I dont know why and how the permutation matrix is formed. By what criterion is it formed?

댓글을 달려면 로그인하십시오.

카테고리

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by