ee823bd38d1614733ae84ae464d5fdc61be4df9b,scipy/linalg/tests/test_basic.py,TestLstsq,test_random_overdet,#TestLstsq#,783
Before Change
def test_random_overdet(self):
n = 20
m = 15
a = random([n,m])
for i in range(m):
a[i,i] = 20*(.1+a[i,i])
for i in range(4):
b = random([n,3])
x,res,r,s = lstsq(a,b)
assert_(r == m, "unexpected efficient rank")
// XXX: check definition of res
assert_array_almost_equal(x,direct_lstsq(a,b))
def test_random_complex_overdet(self):
n = 20
m = 15
After Change
def test_random_overdet(self):
for dtype in REAL_DTYPES:
for (n,m) in ((20,15), (200,2)):
for lapack_driver in TestLstsq.lapack_drivers:
for overwrite in (True,False):
a = np.asarray(random([n,m]),dtype=dtype)
print(a.dtype)
for i in range(m):
a[i,i] = 20*(.1+a[i,i])
for i in range(4):
b = np.asarray(random([n,3]),dtype=dtype)
// Store values in case they are overwritten
// later
a1 = a.copy()
b1 = b.copy()
out = lstsq(a1,b1,lapack_driver=lapack_driver,
overwrite_a=overwrite,
overwrite_b=overwrite)
x = out[0]
r = out[2]
assert_(r == m, "unexpected efficient rank")
assert_allclose(x, direct_lstsq(a,b,cmplx=0),
rtol=25*np.finfo(a1.dtype).eps,
atol=25*np.finfo(a1.dtype).eps,
err_msg="driver: %s" % lapack_driver)
def test_random_complex_overdet(self):
for dtype in COMPLEX_DTYPES:
for (n,m) in ((20,15), (200,2)):
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 30
Instances
Project Name: scipy/scipy
Commit Name: ee823bd38d1614733ae84ae464d5fdc61be4df9b
Time: 2015-11-12
Author: alex.grigorievskiy@gmail.com
File Name: scipy/linalg/tests/test_basic.py
Class Name: TestLstsq
Method Name: test_random_overdet
Project Name: scipy/scipy
Commit Name: ee823bd38d1614733ae84ae464d5fdc61be4df9b
Time: 2015-11-12
Author: alex.grigorievskiy@gmail.com
File Name: scipy/linalg/tests/test_basic.py
Class Name: TestLstsq
Method Name: test_random_overdet
Project Name: scipy/scipy
Commit Name: ee823bd38d1614733ae84ae464d5fdc61be4df9b
Time: 2015-11-12
Author: alex.grigorievskiy@gmail.com
File Name: scipy/linalg/tests/test_basic.py
Class Name: TestLstsq
Method Name: test_random_exact
Project Name: scipy/scipy
Commit Name: ee823bd38d1614733ae84ae464d5fdc61be4df9b
Time: 2015-11-12
Author: alex.grigorievskiy@gmail.com
File Name: scipy/linalg/tests/test_basic.py
Class Name: TestLstsq
Method Name: test_random_complex_overdet