Skip to content

Commit 346f5fa

Browse files
committed
DOC: vdot: adjustments per review
1 parent 4dfc890 commit 346f5fa

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

numpy/_core/multiarray.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -842,20 +842,22 @@ def dot(a, b, out=None):
842842

843843
@array_function_from_c_func_and_dispatcher(_multiarray_umath.vdot)
844844
def vdot(a, b):
845-
"""
845+
r"""
846846
vdot(a, b, /)
847847
848848
Return the dot product of two vectors.
849849
850-
The vdot(`a`, `b`) function handles complex numbers differently than
851-
dot(`a`, `b`). If the first argument is complex the complex conjugate
852-
of the first argument is used for the calculation of the dot product.
850+
The `vdot` function handles complex numbers differently than `dot`:
851+
if the first argument is complex, it is replaced by its complex conjugate
852+
in the dot product calculation. `vdot` also handles multidimensional
853+
arrays differently than `dot`: it does not perform a matrix product, but
854+
flattens the arguments to 1-D arrays before taking a vector dot product.
853855
854-
Note that `vdot` handles multidimensional arrays differently than `dot`:
855-
it does not perform a matrix product, but flattens input arguments to 1-D vectors first.
856-
The runtime of this function is linear in `a.size` and `b.size`. When `(a, b)` are 2-D arrays
857-
of the same shape, this function returns their `Frobenius inner-product` (also known as the
858-
*trace inner product* or the *standard inner product* on a vector space of matrices).
856+
Consequently, when the arguments are 2-D arrays of the same shape, this
857+
function effectively returns their
858+
`Frobenius inner product <https://en.wikipedia.org/wiki/Frobenius_inner_product>`_.
859+
(also known as the *trace inner product* or the *standard inner product*
860+
on a vector space of matrices).
859861
860862
Parameters
861863
----------
@@ -896,7 +898,7 @@ def vdot(a, b):
896898
>>> 1*4 + 4*1 + 5*2 + 6*2
897899
30
898900
899-
"""
901+
""" # noqa: E501
900902
return (a, b)
901903

902904

0 commit comments

Comments
 (0)