10-26-2015, 03:04 PM
The QR() command returns the QR factorization of a matrix and includes a permutation matrix. I cannot seem to find an example of a matrix for which the QR factorization returns a permutation matrix that is non-identity. Is anyone able to find such a case? From the looks of it, the QR() command does not appear to do any pivoting (the diagonals of R are not in non-increasing order). For example:
M2:=[[1,2],[3,5],[-1,7],[2,-1]]
QR(M2);
returns
So is there no pivoting? And if not, then it appears the P matrix is superfluous.
M2:=[[1,2],[3,5],[-1,7],[2,-1]]
QR(M2);
returns
Code:
[
[0.258198889747,0.169657961696,0.94436252598,−0.112822554889],
[0.774596669241,0.393298002112,−0.326894720531,−0.372097464682],
[−0.258198889747,0.871424985073,−3.63216356146e−2,0.415490755024],
[0.516397779494,−0.23906349148,0,0.82230285198]
],
[
[3.87298334621,2.06559111798],
[0,8.64484432094],
[0,0],
[0,0]
],
[
[1,0,0,0],
[0,1,0,0],
[0,0,1,0],
[0,0,0,1]
]
So is there no pivoting? And if not, then it appears the P matrix is superfluous.