|
1 |
| -"""Gufunc'ed versions of linalg. |
| 1 | +"""Linear Algebra functions implemented as gufuncs, so they can be broadcast. |
2 | 2 |
|
3 | 3 | Notes
|
4 | 4 | -----
|
5 | 5 | This modules contains functionality that could be found in the linalg module,
|
6 | 6 | but in a gufunc-like way. This allows the use of vectorization and broadcasting
|
7 | 7 | on the operands.
|
8 | 8 |
|
9 |
| -There are also some extra useful ufuncs. |
| 9 | +Additional functions some fused arithmetic, useful for efficient operation over |
10 | 10 | """
|
11 | 11 |
|
12 | 12 | __all__ = ['inner1d', 'innerwt', 'matrix_multiply', 'det', 'slogdet', 'inv',
|
|
18 | 18 | import numpy.core.umath_linalg as _impl
|
19 | 19 | import numpy as np
|
20 | 20 |
|
21 |
| -""" |
22 |
| - <Description> |
23 |
| - |
24 |
| - Parameters |
25 |
| - ---------- |
26 |
| - <insert parameters + explanations> |
27 |
| -
|
28 |
| - Returns |
29 |
| - ------- |
30 |
| - <insert return values> |
31 |
| -
|
32 |
| - Notes |
33 |
| - ----- |
34 |
| - <insert any notes that may be interesting, optional> |
35 |
| -
|
36 |
| - See Also |
37 |
| - -------- |
38 |
| - <reference related functions> |
39 |
| -
|
40 |
| - Examples |
41 |
| - -------- |
42 |
| - <Some example in doctest format> |
43 |
| -""" |
44 | 21 | def inner1d(a, b, **kwargs):
|
45 | 22 | """
|
46 | 23 | Compute the inner product, with broadcasting
|
@@ -827,7 +804,48 @@ def multiply4_add(a, b, c, d, e, **kwargs):
|
827 | 804 |
|
828 | 805 | def eigh(A, UPLO='L', **kw_args):
|
829 | 806 | """
|
830 |
| - Computes the eigen values and eigenvectors for the square matrices in the inner dimensions of A, being those matrices symmetric/hermitian |
| 807 | + Computes the eigen values and eigenvectors for the square matrices |
| 808 | + in the inner dimensions of A, being those matrices |
| 809 | + symmetric/hermitian. |
| 810 | +
|
| 811 | + Parameters |
| 812 | + ---------- |
| 813 | + A : (<NDIMS>, M, M) array |
| 814 | + Hermitian/Symmetric matrices whose eigenvalues and |
| 815 | + eigenvectors are to be computed. |
| 816 | + UPLO : {'L', 'U'}, optional |
| 817 | + Specifies whether the calculation is done with the lower |
| 818 | + triangular part of the elements in `A` ('L', default) or |
| 819 | + the upper triangular part ('U'). |
| 820 | +
|
| 821 | + Returns |
| 822 | + ------- |
| 823 | + w : (<NDIMS>, M) array |
| 824 | + The eigenvalues, not necessarily ordered. |
| 825 | + v : (<NDIMS>, M, M) array |
| 826 | + The inner dimensions contain matrices with the normalized |
| 827 | + eigenvectors as columns. The column-numbers are coherent with |
| 828 | + the associated eigenvalue. |
| 829 | +
|
| 830 | + Notes |
| 831 | + ----- |
| 832 | + Numpy broadcasting rules apply. |
| 833 | +
|
| 834 | + The eigenvalues/eigenvectors are computed using LAPACK routines _ssyevd, |
| 835 | + _heevd |
| 836 | +
|
| 837 | + Implemented for single, double, csingle and cdouble. Numpy conversion |
| 838 | + rules apply. |
| 839 | +
|
| 840 | + See Also |
| 841 | + -------- |
| 842 | + eigvalsh : eigenvalues of symmetric/hermitian arrays. |
| 843 | + eig : eigenvalues and right eigenvectors for general matrices. |
| 844 | + eigvals : eigenvalues for general matrices. |
| 845 | +
|
| 846 | + Examples |
| 847 | + -------- |
| 848 | + <Some example in doctest format> |
831 | 849 | """
|
832 | 850 | if 'L' == UPLO:
|
833 | 851 | gufunc = _impl.eigh_lo
|
@@ -905,3 +923,29 @@ def poinv(A, UPLO='L', **kw_args):
|
905 | 923 | gufunc = _impl.poinv_up
|
906 | 924 |
|
907 | 925 | return gufunc(A, **kw_args);
|
| 926 | + |
| 927 | + |
| 928 | +""" doc template (23 lines)""" |
| 929 | +""" |
| 930 | + <Description> |
| 931 | + |
| 932 | + Parameters |
| 933 | + ---------- |
| 934 | + <insert parameters + explanations> |
| 935 | +
|
| 936 | + Returns |
| 937 | + ------- |
| 938 | + <insert return values> |
| 939 | +
|
| 940 | + Notes |
| 941 | + ----- |
| 942 | + <insert any notes that may be interesting, optional> |
| 943 | +
|
| 944 | + See Also |
| 945 | + -------- |
| 946 | + <reference related functions> |
| 947 | +
|
| 948 | + Examples |
| 949 | + -------- |
| 950 | + <Some example in doctest format> |
| 951 | +""" |
0 commit comments