ee823bd38d1614733ae84ae464d5fdc61be4df9b,scipy/linalg/tests/test_basic.py,TestLstsq,test_random_complex_overdet,#TestLstsq#,796

Before Change


            assert_array_almost_equal(x,direct_lstsq(a,b))

    def test_random_complex_overdet(self):
        n = 20
        m = 15
        a = random([n,m]) + 1j * random([n,m])
        for i in range(m):
            a[i,i] = 20*(.1+a[i,i])
        for i in range(2):
            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,1))

    def test_check_finite(self):
        a = [[1,20],[-30,4]]
        for b in ([[1,0],[0,1]],[1,0],

After Change



    def test_random_complex_overdet(self):

        for dtype in COMPLEX_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]) + 1j*random([n,m]),
                                           dtype=dtype)
                            for i in range(m):
                                a[i,i] = 20*(.1+a[i,i])
                            for i in range(2):
                                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=1),
                                          rtol=25*np.finfo(a1.dtype).eps,
                                          atol=25*np.finfo(a1.dtype).eps,
                                          err_msg="driver: %s" % lapack_driver)

    def test_check_finite(self):
        for dtype in REAL_DTYPES:
            a = np.array(((1,20),(-30,4)), dtype=dtype)
            for bt in (((1,0),(0,1)),(1,0),
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 29

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_complex_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


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