提交 6366d769 authored 作者: Frédéric Bastien's avatar Frédéric Bastien 提交者: GitHub

Merge pull request #4986 from bscellier/fix_deprecation2

delete options 'full' and 'economic' in test_qr_modes
......@@ -533,7 +533,7 @@ class QRIncomplete(Op):
self.mode)
def qr(a, mode="full"):
def qr(a, mode="reduced"):
"""
Computes the QR decomposition of a matrix.
Factor the matrix a as qr, where q
......@@ -544,7 +544,7 @@ def qr(a, mode="full"):
a : array_like, shape (M, N)
Matrix to be factored.
mode : {'reduced', 'complete', 'r', 'raw', 'full', 'economic'}, optional
mode : {'reduced', 'complete', 'r', 'raw'}, optional
If K = min(M, N), then
'reduced'
......@@ -559,27 +559,14 @@ def qr(a, mode="full"):
'raw'
returns h, tau with dimensions (N, M), (K,)
'full'
alias of 'reduced', deprecated (default)
'economic'
returns h from 'raw', deprecated.
The options 'reduced', 'complete', and 'raw' are new in numpy
1.8, see the notes for more information. The default is
'reduced' and to maintain backward compatibility with earlier
versions of numpy both it and the old default 'full' can be
versions of numpy it can be
omitted. Note that array h returned in 'raw' mode is
transposed for calling Fortran. The 'economic' mode is
deprecated. The modes 'full' and 'economic' may be passed
using only the first letter for backwards compatibility, but
all others must be spelled out.
Default mode is 'full' which is also default for numpy 1.6.1.
transposed for calling Fortran.
:note: Default mode was left to full as full and reduced are
both doing the same thing in the new numpy version but only
full works on the old previous numpy version.
Default mode is 'reduced' which is also default for numpy 1.8
Returns
-------
......
......@@ -130,7 +130,7 @@ def test_qr_modes():
n_qr = numpy.linalg.qr(a)
assert _allclose(n_qr, t_qr)
for mode in ["reduced", "r", "raw", "full", "economic"]:
for mode in ["reduced", "r", "raw"]:
f = function([A], qr(A, mode))
t_qr = f(a)
n_qr = numpy.linalg.qr(a, mode)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论