ee823bd38d1614733ae84ae464d5fdc61be4df9b,scipy/linalg/tests/test_basic.py,TestLstsq,test_simple_overdet,#TestLstsq#,741

Before Change


            assert_array_almost_equal(dot(a,x),b)

    def test_simple_overdet(self):
        a = [[1,2],[4,5],[3,4]]
        b = [1,2,3]
        x,res,r,s = lstsq(a,b)
        assert_array_almost_equal(x,direct_lstsq(a,b))
        assert_almost_equal((abs(dot(a,x) - b)**2).sum(axis=0), res)

    def test_simple_overdet_complex(self):

After Change


    def test_simple_overdet(self):

        for dtype in REAL_DTYPES:
            a = np.array(((1,2),(4,5),(3,4)), dtype=dtype)
            b = np.array((1,2,3), 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]
                    residuals = out[1]
                    r = out[2]
                    assert_(r == 2, "unexpected efficient rank")
                    assert_allclose(abs((dot(a,x) - b)**2).sum(axis=0),
                                    residuals,
                                    rtol=25*np.finfo(a1.dtype).eps,
                                    atol=25*np.finfo(a1.dtype).eps,
                                    err_msg="driver: %s" % lapack_driver)
                    assert_allclose(x,(-0.428571428571429, 0.85714285714285),
                                    rtol=25*np.finfo(a1.dtype).eps,
                                    atol=25*np.finfo(a1.dtype).eps,
                                    err_msg="driver: %s" % lapack_driver)

    def test_simple_overdet_complex(self):

        for dtype in COMPLEX_DTYPES:
            a = np.array(((1+2j,2),(4,5),(3,4)), dtype=dtype)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 10

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_overdet


Project Name: has2k1/plotnine
Commit Name: 14538c6714f45c0dbd6c95ff351c272c9cf85701
Time: 2014-04-29
Author: has2k1@gmail.com
File Name: ggplot/stats/stat_abline.py
Class Name: stat_abline
Method Name: _calculate


Project Name: NifTK/NiftyNet
Commit Name: ae9cf55f6a5775a0d39a869166e8b33d4f39c273
Time: 2017-04-12
Author: wenqi.li@ucl.ac.uk
File Name: region_properties.py
Class Name: RegionProperties
Method Name: __compute_mask