Computes the vector dot product.
This function is restricted to arguments compatible with the Array API, contrary to numpy.vecdot.
Let \(\mathbf{a}\) be a vector in x1 and \(\mathbf{b}\) be a corresponding vector in x2. The dot product is defined as:
over the dimension specified by axis and where \(\overline{a_i}\) denotes the complex conjugate if \(a_i\) is complex and the identity otherwise.
First input array.
Second input array.
Axis over which to compute the dot product. Default: -1.
The vector dot product of the input.
See also
Get the projected size along a given normal for an array of vectors.
>>> v = np.array([[0., 5., 0.], [0., 0., 10.], [0., 6., 8.]]) >>> n = np.array([0., 0.6, 0.8]) >>> np.linalg.vecdot(v, n) array([ 3., 8., 10.])
© 2005–2024 NumPy Developers
Licensed under the 3-clause BSD License.
https://numpy.org/doc/2.4/reference/generated/numpy.linalg.vecdot.html