I run a qr factorization
in numpy
which returns a list of ndarrays
, namely Q
and R
:
>>> [q,r] = np.linalg.qr(np.array([1,0,0,0,1,1,1,1,1]).reshape(3,3))
R
is a two-dimensional array, having pivoted zero-lines at the bottom (even proved for all examples in my test set):
>>> print r
[[ 1.41421356 0.70710678 0.70710678]
[ 0. 1.22474487 1.22474487]
[ 0. 0. 0. ]]
. Now, I want to divide R
in two matrices R_~
:
[[ 1.41421356 0.70710678 0.70710678]
[ 0. 1.22474487 1.22474487]]
and R_0
:
[[ 0. 0. 0. ]]
(extracting all zero-lines). It seems to be close to this solution: deleting rows in numpy array.
EDIT:
Even more interesting: np.linalg.qr()
returns a n x n
-matrix. Not, what I would have expected:
A := n x m
Q := n x m
R := n x m