Overview:
- The vdot() function returns the dot product of two vectors.
- Two input vectors are provided as 1 to n-dimensional arrays. The dot product of multi-dimensional arrays are computed after flattening them to one-dimensional arrays.
Example:
# Example Python program that computes the dot # Create the first 2-d array # Create the second 2-d array # Compute the dot product |
Output:
Array1: [[ 5 10 15] [20 25 30] [35 40 45]] Array2: [[ 2 4 6] [ 8 10 12] [14 16 18]] Dot product: 2850 |