

def test_types(self):
    for dtype in np.typecodes['AllFloat']:
        x = np.array([1, 2, 3], dtype=dtype)
        tol = max(1e-15, (np.finfo(dtype).eps.real * 20))
        assert_allclose(norm(x), np.sqrt(14), rtol=tol)
        assert_allclose(norm(x, 2), np.sqrt(14), rtol=tol)
    for dtype in np.typecodes['Complex']:
        x = np.array([1j, 2j, 3j], dtype=dtype)
        tol = max(1e-15, (np.finfo(dtype).eps.real * 20))
        assert_allclose(norm(x), np.sqrt(14), rtol=tol)
        assert_allclose(norm(x, 2), np.sqrt(14), rtol=tol)

dataset/ETHPy150Open scipy/scipy/scipy/linalg/tests/test_basic.py TestVectorNorms.test_types/original