@@ -1092,15 +1092,10 @@ def qr(a, mode='reduced'):
1092
1092
a = _to_native_byte_order (a )
1093
1093
mn = min (m , n )
1094
1094
1095
- if m <= n :
1096
- gufunc = _umath_linalg .qr_r_raw_m
1097
- else :
1098
- gufunc = _umath_linalg .qr_r_raw_n
1099
-
1100
1095
signature = 'D->D' if isComplexType (t ) else 'd->d'
1101
1096
with errstate (call = _raise_linalgerror_qr , invalid = 'call' ,
1102
1097
over = 'ignore' , divide = 'ignore' , under = 'ignore' ):
1103
- tau = gufunc (a , signature = signature )
1098
+ tau = _umath_linalg . qr_r_raw (a , signature = signature )
1104
1099
1105
1100
# handle modes that don't return q
1106
1101
if mode == 'r' :
@@ -1833,15 +1828,9 @@ def svd(a, full_matrices=True, compute_uv=True, hermitian=False):
1833
1828
m , n = a .shape [- 2 :]
1834
1829
if compute_uv :
1835
1830
if full_matrices :
1836
- if m < n :
1837
- gufunc = _umath_linalg .svd_m_f
1838
- else :
1839
- gufunc = _umath_linalg .svd_n_f
1831
+ gufunc = _umath_linalg .svd_f
1840
1832
else :
1841
- if m < n :
1842
- gufunc = _umath_linalg .svd_m_s
1843
- else :
1844
- gufunc = _umath_linalg .svd_n_s
1833
+ gufunc = _umath_linalg .svd_s
1845
1834
1846
1835
signature = 'D->DdD' if isComplexType (t ) else 'd->ddd'
1847
1836
with errstate (call = _raise_linalgerror_svd_nonconvergence ,
@@ -1853,16 +1842,11 @@ def svd(a, full_matrices=True, compute_uv=True, hermitian=False):
1853
1842
vh = vh .astype (result_t , copy = False )
1854
1843
return SVDResult (wrap (u ), s , wrap (vh ))
1855
1844
else :
1856
- if m < n :
1857
- gufunc = _umath_linalg .svd_m
1858
- else :
1859
- gufunc = _umath_linalg .svd_n
1860
-
1861
1845
signature = 'D->d' if isComplexType (t ) else 'd->d'
1862
1846
with errstate (call = _raise_linalgerror_svd_nonconvergence ,
1863
1847
invalid = 'call' , over = 'ignore' , divide = 'ignore' ,
1864
1848
under = 'ignore' ):
1865
- s = gufunc (a , signature = signature )
1849
+ s = _umath_linalg . svd (a , signature = signature )
1866
1850
s = s .astype (_realType (result_t ), copy = False )
1867
1851
return s
1868
1852
@@ -2570,11 +2554,6 @@ def lstsq(a, b, rcond=None):
2570
2554
if rcond is None :
2571
2555
rcond = finfo (t ).eps * max (n , m )
2572
2556
2573
- if m <= n :
2574
- gufunc = _umath_linalg .lstsq_m
2575
- else :
2576
- gufunc = _umath_linalg .lstsq_n
2577
-
2578
2557
signature = 'DDd->Ddid' if isComplexType (t ) else 'ddd->ddid'
2579
2558
if n_rhs == 0 :
2580
2559
# lapack can't handle n_rhs = 0 - so allocate
@@ -2583,7 +2562,8 @@ def lstsq(a, b, rcond=None):
2583
2562
2584
2563
with errstate (call = _raise_linalgerror_lstsq , invalid = 'call' ,
2585
2564
over = 'ignore' , divide = 'ignore' , under = 'ignore' ):
2586
- x , resids , rank , s = gufunc (a , b , rcond , signature = signature )
2565
+ x , resids , rank , s = _umath_linalg .lstsq (a , b , rcond ,
2566
+ signature = signature )
2587
2567
if m == 0 :
2588
2568
x [...] = 0
2589
2569
if n_rhs == 0 :
0 commit comments