8000 DOC: Added docstring for eigh · numpy/numpy@43c25bb · GitHub
[go: up one dir, main page]

Skip to content

Commit 43c25bb

Browse files
ovillellaspv
ovillellas
authored andcommitted
DOC: Added docstring for eigh
1 parent 170726c commit 43c25bb

File tree

1 file changed

+70
-26
lines changed

1 file changed

+70
-26
lines changed

numpy/core/src/umath/gufuncs_linalg.py

Lines changed: 70 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
"""Gufunc'ed versions of linalg.
1+
"""Linear Algebra functions implemented as gufuncs, so they can be broadcast.
22
33
Notes
44
-----
55
This modules contains functionality that could be found in the linalg module,
66
but in a gufunc-like way. This allows the use of vectorization and broadcasting
77
on the operands.
88
9-
There are also some extra useful ufuncs.
9+
Additional functions some fused arithmetic, useful for efficient operation over
1010
"""
1111

1212
__all__ = ['inner1d', 'innerwt', 'matrix_multiply', 'det', 'slogdet', 'inv',
@@ -18,29 +18,6 @@
1818
import numpy.core.umath_linalg as _impl
1919
import numpy as np
2020

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-
"""
4421
def inner1d(a, b, **kwargs):
4522
"""
4623
Compute the inner product, with broadcasting
@@ -827,7 +804,48 @@ def multiply4_add(a, b, c, d, e, **kwargs):
827804

828805
def eigh(A, UPLO='L', **kw_args):
829806
"""
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>
831849
"""
832850
if 'L' == UPLO:
833851
gufunc = _impl.eigh_lo
@@ -905,3 +923,29 @@ def poinv(A, UPLO='L', **kw_args):
905923
gufunc = _impl.poinv_up
906924

907925
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

Comments
 (0)
0