__init__.py 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. """
  2. ``numpy.linalg``
  3. ================
  4. The NumPy linear algebra functions rely on BLAS and LAPACK to provide efficient
  5. low level implementations of standard linear algebra algorithms. Those
  6. libraries may be provided by NumPy itself using C versions of a subset of their
  7. reference implementations but, when possible, highly optimized libraries that
  8. take advantage of specialized processor functionality are preferred. Examples
  9. of such libraries are OpenBLAS, MKL (TM), and ATLAS. Because those libraries
  10. are multithreaded and processor dependent, environmental variables and external
  11. packages such as threadpoolctl may be needed to control the number of threads
  12. or specify the processor architecture.
  13. - OpenBLAS: https://www.openblas.net/
  14. - threadpoolctl: https://github.com/joblib/threadpoolctl
  15. Please note that the most-used linear algebra functions in NumPy are present in
  16. the main ``numpy`` namespace rather than in ``numpy.linalg``. There are:
  17. ``dot``, ``vdot``, ``inner``, ``outer``, ``matmul``, ``tensordot``, ``einsum``,
  18. ``einsum_path`` and ``kron``.
  19. Functions present in numpy.linalg are listed below.
  20. Matrix and vector products
  21. --------------------------
  22. cross
  23. multi_dot
  24. matrix_power
  25. tensordot
  26. matmul
  27. Decompositions
  28. --------------
  29. cholesky
  30. outer
  31. qr
  32. svd
  33. svdvals
  34. Matrix eigenvalues
  35. ------------------
  36. eig
  37. eigh
  38. eigvals
  39. eigvalsh
  40. Norms and other numbers
  41. -----------------------
  42. norm
  43. matrix_norm
  44. vector_norm
  45. cond
  46. det
  47. matrix_rank
  48. slogdet
  49. trace (Array API compatible)
  50. Solving equations and inverting matrices
  51. ----------------------------------------
  52. solve
  53. tensorsolve
  54. lstsq
  55. inv
  56. pinv
  57. tensorinv
  58. Other matrix operations
  59. -----------------------
  60. diagonal (Array API compatible)
  61. matrix_transpose (Array API compatible)
  62. Exceptions
  63. ----------
  64. LinAlgError
  65. """
  66. # To get sub-modules
  67. from . import linalg # deprecated in NumPy 2.0
  68. from . import _linalg
  69. from ._linalg import *
  70. __all__ = _linalg.__all__.copy()
  71. from numpy._pytesttester import PytestTester
  72. test = PytestTester(__name__)
  73. del PytestTester