8000 ENH: handle empty matrices in qr decomposition by convexset · Pull Request #11593 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

ENH: handle empty matrices in qr decomposition #11593

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Jul 31, 2018
Merged
Prev Previous commit
Next Next commit
fixed offending quotes
  • Loading branch information
convexset committed Jul 20, 2018
commit 3fa693ae72cc312f2f3601602fb0bacc681ed1ce
10 changes: 5 additions & 5 deletions numpy/linalg/linalg.py
Original file line number Diff line number Diff line change
Expand Up @@ -862,20 +862,20 @@ def qr(a, mode='reduced'):
if _isEmpty2d(a):
k = min(m, n)
if mode == 'reduced':
# reduced: returns q, r with dimensions (M, K), (K, N) (default)
# 'reduced': returns q, r with dimensions (M, K), (K, N) (default)
return empty((m, k)), empty((k, n))
elif mode == 'r':
# ‘r’ : returns r only with dimensions (K, N)
# 'r': returns r only with dimensions (K, N)
return empty((k, n))
elif mode == 'complete':
# complete: returns q, r with dimensions (M, M), (M, N)
# 'complete': returns q, r with dimensions (M, M), (M, N)
return eye(m), empty((m, n))
elif mode in ('raw', 'economic'):
# raw: returns h, tau with dimensions (N, M), (K,)
# 'raw': returns h, tau with dimensions (N, M), (K,)
h = empty((n, m))
tau = empty(k)
if mode == 'economic':
# economic: returns h from raw, deprecated.
# 'economic': returns h from raw, deprecated.
return h
else:
return h, tau
Expand Down
0