first input array
second input array
dimension for which to compute the dot product (default: -1)
dot product
var Float32Array = require( '@stdlib/array/float32' );
var array = require( '@stdlib/ndarray/array' );
var x = array( new Float32Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] ) );
var y = array( new Float32Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] ) );
var z = sdot( x, y );
returns <ndarray>
var v = z.get();
// returns -5.0
Computes the dot product of two single-precision floating-point vectors.
Notes
x
andy
according to the specified dimension index.0
.-1
.first argument must be a non-zero-dimensional ndarray containing single-precision floating-point numbers
second argument must be a non-zero-dimensional ndarray containing single-precision floating-point numbers
input arrays must be broadcast-compatible
the size of the contracted dimension must be the same for both input arrays