Vector-matrix dot product of two arrays.
Given a vector (or stack of vector) \(\mathbf{v}\) in x1 and a matrix (or stack of matrices) \(\mathbf{A}\) in x2, the vector-matrix product is defined as:
where the sum is over the last dimension of x1 and the one-but-last dimensions in x2 (unless axes is specified) and where \(\overline{v_i}\) denotes the complex conjugate if \(v\) is complex and the identity otherwise. (For a non-conjugated vector-matrix product, use np.matvec(x2.mT, x1).)
New in version 2.2.0.
Input arrays, scalars not allowed.
A location into which the result is stored. If provided, it must have the broadcasted shape of x1 and x2 with the summation axis removed. If not provided or None, a freshly-allocated array is used.
For other keyword-only arguments, see the ufunc docs.
The vector-matrix product of the inputs.
If the last dimensions of x1 and the one-but-last dimension of x2 are not the same size.
If a scalar value is passed in.
See also
Project a vector along X and Y.
>>> v = np.array([0., 4., 2.]) >>> a = np.array([[1., 0., 0.], ... [0., 1., 0.], ... [0., 0., 0.]]) >>> np.vecmat(v, a) array([ 0., 4., 0.])
© 2005–2024 NumPy Developers
Licensed under the 3-clause BSD License.
https://numpy.org/doc/2.4/reference/generated/numpy.vecmat.html