|
2 | 2 | {{alias}}( N, x, strideX, y, strideY )
|
3 | 3 | Computes the dot product of two single-precision floating-point vectors.
|
4 | 4 |
|
5 |
| - The `N`, `strideX`, and `strideY` parameters determine which elements in `x` |
6 |
| - and `y` are accessed at runtime. |
| 5 | + The `N` and stride parameters determine which elements in the |
| 6 | + strided arrays are accessed at runtime. |
7 | 7 |
|
8 | 8 | Indexing is relative to the first index. To introduce an offset, use a typed
|
9 | 9 | array view.
|
|
30 | 30 | Returns
|
31 | 31 | -------
|
32 | 32 | dot: float
|
33 |
| - The dot product of `x` and `y`. |
| 33 | + Output array. |
34 | 34 |
|
35 | 35 | Examples
|
36 | 36 | --------
|
|
43 | 43 | // Strides:
|
44 | 44 | > x = new {{alias:@stdlib/array/float32}}( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
|
45 | 45 | > y = new {{alias:@stdlib/array/float32}}( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] );
|
46 |
| - > var N = {{alias:@stdlib/math/base/special/floor}}( x.length / 2 ); |
47 |
| - > dot = {{alias}}( N, x, 2, y, -1 ) |
| 46 | + > dot = {{alias}}( 3, x, 2, y, -1 ) |
48 | 47 | 9.0
|
49 | 48 |
|
50 | 49 | // Using view offsets:
|
51 | 50 | > x = new {{alias:@stdlib/array/float32}}( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
|
52 | 51 | > y = new {{alias:@stdlib/array/float32}}( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );
|
53 | 52 | > var x1 = new {{alias:@stdlib/array/float32}}( x.buffer, x.BYTES_PER_ELEMENT*1 );
|
54 | 53 | > var y1 = new {{alias:@stdlib/array/float32}}( y.buffer, y.BYTES_PER_ELEMENT*3 );
|
55 |
| - > N = {{alias:@stdlib/math/base/special/floor}}( x.length / 2 ); |
56 |
| - > dot = {{alias}}( N, x1, -2, y1, 1 ) |
| 54 | + > dot = {{alias}}( 3, x1, -2, y1, 1 ) |
57 | 55 | 128.0
|
58 | 56 |
|
59 | 57 | {{alias}}.ndarray( N, x, strideX, offsetX, y, strideY, offsetY )
|
60 | 58 | Computes the dot product of two single-precision floating-point vectors
|
61 | 59 | using alternative indexing semantics.
|
62 | 60 |
|
63 | 61 | While typed array views mandate a view offset based on the underlying
|
64 |
| - buffer, the `offsetX` and `offsetY` parameters support indexing based on a |
| 62 | + buffer, the offset parameters support indexing based on a |
65 | 63 | starting index.
|
66 | 64 |
|
67 | 65 | Parameters
|
|
90 | 88 | Returns
|
91 | 89 | -------
|
92 | 90 | dot: float
|
93 |
| - The dot product of `x` and `y`. |
| 91 | + Output array. |
94 | 92 |
|
95 | 93 | Examples
|
96 | 94 | --------
|
|
103 | 101 | // Strides:
|
104 | 102 | > x = new {{alias:@stdlib/array/float32}}( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
|
105 | 103 | > y = new {{alias:@stdlib/array/float32}}( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] );
|
106 |
| - > var N = {{alias:@stdlib/math/base/special/floor}}( x.length / 2 ); |
107 |
| - > dot = {{alias}}.ndarray( N, x, 2, 0, y, 2, 0 ) |
| 104 | + > dot = {{alias}}.ndarray( 3, x, 2, 0, y, 2, 0 ) |
108 | 105 | 9.0
|
109 | 106 |
|
110 | 107 | // Using offset indices:
|
111 | 108 | > x = new {{alias:@stdlib/array/float32}}( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
|
112 | 109 | > y = new {{alias:@stdlib/array/float32}}( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );
|
113 |
| - > N = {{alias:@stdlib/math/base/special/floor}}( x.length / 2 ); |
114 |
| - > dot = {{alias}}.ndarray( N, x, -2, x.length-1, y, 1, 3 ) |
| 110 | + > dot = {{alias}}.ndarray( 3, x, -2, x.length-1, y, 1, 3 ) |
115 | 111 | 128.0
|
116 | 112 |
|
117 | 113 | See Also
|
|
0 commit comments