@@ -30,11 +30,9 @@ limitations under the License.
3030var dcartesianProduct = require ( ' @stdlib/blas/ext/base/dcartesian-product' );
3131```
3232
33- <!-- lint disable maximum-heading-length -->
33+ #### dcartesianProduct( M, N, x, strideX, y, strideY, out, LDO )
3434
35- #### dcartesianProduct( M, N, x, strideX, y, strideY, out, strideOut1, strideOut2 )
36-
37- Computes the Cartesian product for a double-precision floating-point strided array.
35+ Computes the Cartesian product for two double-precision floating-point strided arrays.
3836
3937``` javascript
4038var Float64Array = require ( ' @stdlib/array/float64' );
@@ -44,7 +42,7 @@ var y = new Float64Array( [ 3.0, 4.0 ] );
4442var out = new Float64Array ( 8 );
4543
4644// Compute the Cartesian product:
47- dcartesianProduct ( x .length , y .length , x, 1 , y, 1 , out, 2 , 1 );
45+ dcartesianProduct ( x .length , y .length , x, 1 , y, 1 , out, 2 );
4846// out => <Float64Array>[ 1.0, 3.0, 1.0, 4.0, 2.0, 3.0, 2.0, 4.0 ]
4947```
5048
@@ -57,10 +55,9 @@ The function has the following parameters:
5755- ** y** : input [ ` Float64Array ` ] [ @stdlib/array/float64 ] .
5856- ** strideY** : stride length for ` y ` .
5957- ** out** : output [ ` Float64Array ` ] [ @stdlib/array/float64 ] .
60- - ** strideOut1** : stride length between consecutive output pairs.
61- - ** strideOut2** : stride length between the two elements of each output pair.
58+ - ** LDO** : stride of the leading dimension of ` out ` .
6259
63- The ` N ` , ` M ` and stride parameters determine which elements in the strided arrays are accessed at runtime. For example, to compute the Cartesian square of every other element:
60+ The ` M ` , ` N ` and stride parameters determine which elements in the strided arrays are accessed at runtime. For example, to compute the Cartesian square of every other element:
6461
6562``` javascript
6663var Float64Array = require ( ' @stdlib/array/float64' );
@@ -70,7 +67,7 @@ var y = new Float64Array( [ 3.0, 0.0, 4.0, 0.0 ] );
7067var out = new Float64Array ( 8 );
7168
7269// Compute the Cartesian product:
73- dcartesianProduct ( 2 , 2 , x, 2 , y, 2 , out, 2 , 1 );
70+ dcartesianProduct ( 2 , 2 , x, 2 , y, 2 , out, 2 );
7471// out => <Float64Array>[ 1.0, 3.0, 1.0, 4.0, 2.0, 3.0, 2.0, 4.0 ]
7572```
7673
@@ -90,7 +87,7 @@ var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*1 ); // start at 2nd
9087var out = new Float64Array ( 8 );
9188
9289// Compute the Cartesian product:
93- dcartesianProduct ( 2 , 2 , x1, 1 , y1, 1 , out, 2 , 1 );
90+ dcartesianProduct ( 2 , 2 , x1, 1 , y1, 1 , out, 2 );
9491// out => <Float64Array>[ 1.0, 3.0, 1.0, 4.0, 2.0, 3.0, 2.0, 4.0 ]
9592```
9693
@@ -100,7 +97,7 @@ dcartesianProduct( 2, 2, x1, 1, y1, 1, out, 2, 1 );
10097
10198<!-- lint enable maximum-heading-length-->
10299
103- Computes the Cartesian product for a double-precision floating-point strided array using alternative indexing semantics.
100+ Computes the Cartesian product for two double-precision floating-point strided arrays using alternative indexing semantics.
104101
105102``` javascript
106103var Float64Array = require ( ' @stdlib/array/float64' );
@@ -118,6 +115,8 @@ The function has the following additional parameters:
118115
119116- ** offsetX** : starting index for ` x ` .
120117- ** offsetY** : starting index for ` y ` .
118+ - ** strideOut1** : stride length of the first dimension of ` out ` .
119+ - ** strideOut2** : stride length of the second dimension of ` out ` .
121120- ** offsetOut** : starting index for ` out ` .
122121
123122While [ ` typed array ` ] [ mdn-typed-array ] views mandate a view offset based on the underlying buffer, the offset parameters support indexing semantics based on starting indices. For example, to access only the last two elements:
@@ -142,7 +141,7 @@ dcartesianProduct.ndarray( 2, 2, x, 1, 2, y, 1, 2, out, 2, 1, 0 );
142141
143142## Notes
144143
145- - For an input array ` x ` of length ` N ` , the output array ` out ` must contain at least ` M*N ` pairs.
144+ - For an input array ` x ` of length ` M ` and an input array ` y ` of length ` N ` , the output array ` out ` must contain at least ` M*N ` pairs.
146145- If ` N <= 0 ` or ` M <= 0 ` , both functions return ` out ` unchanged.
147146
148147</section >
@@ -175,7 +174,7 @@ console.log( y );
175174var out = new Float64Array ( M * N * 2 );
176175
177176// Compute the Cartesian product:
178- dcartesianProduct ( M , N , x, 1 , y, 1 , out, 2 , 1 );
177+ dcartesianProduct ( M , N , x, 1 , y, 1 , out, 2 );
179178console .log ( out );
180179```
181180
@@ -209,20 +208,16 @@ console.log( out );
209208#include " stdlib/blas/ext/base/dcartesianproduct.h"
210209```
211210
212- <!-- lint disable maximum-heading-length-->
213-
214- #### stdlib_strided_dcartesian_product( M, N, \* X, strideX, \* Y, strideY, \* Out, strideOut1, strideOut2 )
215-
216- <!-- lint enable maximum-heading-length-->
211+ #### stdlib_strided_dcartesian_product( M, N, \* X, strideX, \* Y, strideY, \* Out, LDO )
217212
218- Computes the Cartesian product for a double-precision floating-point strided array .
213+ Computes the Cartesian product for two double-precision floating-point strided arrays .
219214
220215``` c
221216const double x[] = { 1.0, 2.0 };
222217const double y[ ] = { 3.0, 4.0 };
223218double out[ ] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 };
224219
225- stdlib_strided_dcartesian_product ( 2, 2, x, 1, y, 1, out, 2, 1 );
220+ stdlib_strided_dcartesian_product ( 2, 2, x, 1, y, 1, out, 2 );
226221```
227222
228223The function accepts the following arguments:
@@ -234,11 +229,10 @@ The function accepts the following arguments:
234229- **Y**: `[in] double*` input array.
235230- **strideY**: `[in] CBLAS_INT` stride length for `Y`.
236231- **Out**: `[out] double*` output array.
237- - **strideOut1**: `[in] CBLAS_INT` stride length between consecutive output pairs.
238- - **strideOut2**: `[in] CBLAS_INT` stride length between elements of each output pair.
232+ - **LDO**: `[in] CBLAS_INT` stride of the leading dimension of `Out`.
239233
240234```c
241- void stdlib_strided_dcartesian_product( const CBLAS_INT M, const CBLAS_INT N, const double *X, const CBLAS_INT strideX, const double *Y, const CBLAS_INT strideY, double *Out, const CBLAS_INT strideOut1, const CBLAS_INT strideOut2 );
235+ void stdlib_strided_dcartesian_product( const CBLAS_INT M, const CBLAS_INT N, const double *X, const CBLAS_INT strideX, const double *Y, const CBLAS_INT strideY, double *Out, const CBLAS_INT LDO );
242236```
243237
244238<!-- lint disable maximum-heading-length-->
@@ -247,7 +241,7 @@ void stdlib_strided_dcartesian_product( const CBLAS_INT M, const CBLAS_INT N, co
247241
248242<!-- lint enable maximum-heading-length-->
249243
250- Computes the Cartesian product for a double-precision floating-point strided array using alternative indexing semantics.
244+ Computes the Cartesian product for two double-precision floating-point strided arrays using alternative indexing semantics.
251245
252246``` c
253247const double x[] = { 1.0, 2.0 };
@@ -268,8 +262,8 @@ The function accepts the following arguments:
268262- **strideY**: `[in] CBLAS_INT` stride length for `Y`.
269263- **offsetY**: `[in] CBLAS_INT` starting index for `Y`.
270264- **Out**: `[out] double*` output array.
271- - **strideOut1**: `[in] CBLAS_INT` stride length between consecutive output pairs .
272- - **strideOut2**: `[in] CBLAS_INT` stride length between elements of each output pair .
265+ - **strideOut1**: `[in] CBLAS_INT` stride length of the first dimension of `Out` .
266+ - **strideOut2**: `[in] CBLAS_INT` stride length of the second dimension of `Out` .
273267- **offsetOut**: `[in] CBLAS_INT` starting index for `Out`.
274268
275269```c
@@ -313,11 +307,10 @@ int main( void ) {
313307 // Specify strides:
314308 const int strideX = 1;
315309 const int strideY = 1;
316- const int strideOut1 = 2;
317- const int strideOut2 = 1;
310+ const int LDO = 2;
318311
319312 // Compute the Cartesian product:
320- stdlib_strided_dcartesian_product( M, N, X, strideX, Y, strideY, out, strideOut1, strideOut2 );
313+ stdlib_strided_dcartesian_product( M, N, X, strideX, Y, strideY, out, LDO );
321314
322315 // Print the result:
323316 for ( int i = 0; i < M*N; i++ ) {
0 commit comments