test_cython_lapack.py 796 B

12345678910111213141516171819202122
  1. from numpy.testing import assert_allclose
  2. from scipy.linalg import cython_lapack as cython_lapack
  3. from scipy.linalg import lapack
  4. class TestLamch:
  5. def test_slamch(self):
  6. for c in [b'e', b's', b'b', b'p', b'n', b'r', b'm', b'u', b'l', b'o']:
  7. assert_allclose(cython_lapack._test_slamch(c),
  8. lapack.slamch(c))
  9. def test_dlamch(self):
  10. for c in [b'e', b's', b'b', b'p', b'n', b'r', b'm', b'u', b'l', b'o']:
  11. assert_allclose(cython_lapack._test_dlamch(c),
  12. lapack.dlamch(c))
  13. def test_complex_ladiv(self):
  14. cx = .5 + 1.j
  15. cy = .875 + 2.j
  16. assert_allclose(cython_lapack._test_zladiv(cy, cx), 1.95+0.1j)
  17. assert_allclose(cython_lapack._test_cladiv(cy, cx), 1.95+0.1j)