

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 * (0.1 + a[(i, i)]))
                    for i in range(2):
                        b = np.asarray(random([n, 3]), dtype=dtype)
                        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), ('expected efficient rank %s, got %s' % (m, r)))
                        assert_allclose(x, direct_lstsq(a, b, cmplx=1), rtol=(25 * np.finfo(out.dtype).eps), atol=(25 * np.finfo(a1.dtype).eps), err_msg=('driver: %s' % lapack_driver))

dataset/ETHPy150Open scipy/scipy/scipy/linalg/tests/test_basic.py TestLstsq.test_random_complex_overdet/VarMisuse@256/312 `a1`->`out`