提交 06bf027c authored 作者: Benjamin Scellier's avatar Benjamin Scellier

delete options 'full' and 'economic' in test_qr_modes which are both deprecated

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