ee823bd38d1614733ae84ae464d5fdc61be4df9b,scipy/linalg/tests/test_basic.py,TestLstsq,test_simple_underdet,#TestLstsq#,755
Before Change
assert_almost_equal(res, (abs(dot(a,x) - b)**2).sum(axis=0))
def test_simple_underdet(self):
a = [[1,2,3],[4,5,6]]
b = [1,2]
x,res,r,s = lstsq(a,b)
// XXX: need independent check
assert_array_almost_equal(x,[-0.05555556, 0.11111111, 0.27777778])
def test_random_exact(self):
After Change
err_msg="driver: %s" % lapack_driver)
def test_simple_underdet(self):
for dtype in REAL_DTYPES:
a = np.array(((1,2,3),(4,5,6)), dtype=dtype)
b = np.array((1,2), dtype=dtype)
for lapack_driver in TestLstsq.lapack_drivers:
for overwrite in (True,False):
// 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 == 2, "unexpected efficient rank")
assert_allclose(x,(-0.055555555555555, 0.111111111111111,
0.277777777777777),
rtol=25*np.finfo(a1.dtype).eps,
atol=25*np.finfo(a1.dtype).eps,
err_msg="driver: %s" % lapack_driver)
def test_random_exact(self):
for dtype in REAL_DTYPES:
for n in (20, 200):
for lapack_driver in TestLstsq.lapack_drivers:
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 32
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_simple_underdet
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_simple_underdet
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_simple_overdet_complex
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_simple_overdet