Skip to content

Commit b76249d

Browse files
committed
fix: apply suggestions from code review
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: passed - task: lint_package_json status: na - task: lint_repl_help status: passed - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: missing_dependencies - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: passed - task: lint_license_headers status: passed ---
1 parent fca1b79 commit b76249d

8 files changed

Lines changed: 26 additions & 22 deletions

File tree

lib/node_modules/@stdlib/blas/ext/base/dcartesian-product/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ The function has the following parameters:
5555
- **y**: input [`Float64Array`][@stdlib/array/float64].
5656
- **strideY**: stride length for `y`.
5757
- **out**: output [`Float64Array`][@stdlib/array/float64].
58-
- **LDO**: stride of the leading dimension of `out`.
58+
- **LDO**: stride length for the leading dimension of `out`.
5959

6060
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:
6161

@@ -115,8 +115,8 @@ The function has the following additional parameters:
115115

116116
- **offsetX**: starting index for `x`.
117117
- **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`.
118+
- **strideOut1**: stride length for the first dimension of `out`.
119+
- **strideOut2**: stride length for the second dimension of `out`.
120120
- **offsetOut**: starting index for `out`.
121121

122122
While [`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:
@@ -141,7 +141,7 @@ dcartesianProduct.ndarray( 2, 2, x, 1, 2, y, 1, 2, out, 2, 1, 0 );
141141

142142
## Notes
143143

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.
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*2` elements.
145145
- If `N <= 0` or `M <= 0`, both functions return `out` unchanged.
146146

147147
</section>

lib/node_modules/@stdlib/blas/ext/base/dcartesian-product/docs/repl.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
Output array.
3333

3434
LDO: integer
35-
Stride of the leading dimension of `out`.
35+
Stride length for the leading dimension of `out`.
3636

3737
Returns
3838
-------
@@ -94,10 +94,10 @@
9494
Output array.
9595

9696
so1: integer
97-
Stride length of the first dimension of `out`.
97+
Stride length for the first dimension of `out`.
9898

9999
so2: integer
100-
Stride length of the second dimension of `out`.
100+
Stride length for the second dimension of `out`.
101101

102102
oo: integer
103103
Starting index for `out`.

lib/node_modules/@stdlib/blas/ext/base/dcartesian-product/docs/types/index.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ interface Routine {
3232
* @param y - second input array
3333
* @param strideY - stride length for `y`
3434
* @param out - output array
35-
* @param LDO - stride of the leading dimension of `out`
35+
* @param LDO - stride length for the leading dimension of `out`
3636
* @returns output array
3737
*
3838
* @example
@@ -59,8 +59,8 @@ interface Routine {
5959
* @param strideY - stride length for `y`
6060
* @param offsetY - starting index for `y`
6161
* @param out - output array
62-
* @param strideOut1 - stride length of the first dimension of `out`
63-
* @param strideOut2 - stride length of the second dimension of `out`
62+
* @param strideOut1 - stride length for the first dimension of `out`
63+
* @param strideOut2 - stride length for the second dimension of `out`
6464
* @param offsetOut - starting index for `out`
6565
* @returns output array
6666
*

lib/node_modules/@stdlib/blas/ext/base/dcartesian-product/lib/dcartesianproduct.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ var ndarray = require( './ndarray.js' );
3636
* @param {Float64Array} y - input array
3737
* @param {integer} strideY - stride length for `y`
3838
* @param {Float64Array} out - output array
39-
* @param {integer} LDO - stride of the leading dimension of `out`
39+
* @param {integer} LDO - stride length for the leading dimension of `out`
4040
* @returns {Float64Array} output array
4141
*
4242
* @example
@@ -50,9 +50,13 @@ var ndarray = require( './ndarray.js' );
5050
* // out => <Float64Array>[ 1.0, 3.0, 1.0, 4.0, 2.0, 3.0, 2.0, 4.0 ]
5151
*/
5252
function dcartesianProduct( M, N, x, strideX, y, strideY, out, LDO ) {
53-
var ox = stride2offset( M, strideX );
54-
var oy = stride2offset( N, strideY );
55-
var oo = stride2offset( M * N, LDO );
53+
var ox;
54+
var oy;
55+
var oo;
56+
57+
ox = stride2offset( M, strideX );
58+
oy = stride2offset( N, strideY );
59+
oo = stride2offset( M * N, LDO );
5660
return ndarray( M, N, x, strideX, ox, y, strideY, oy, out, LDO, 1, oo );
5761
}
5862

lib/node_modules/@stdlib/blas/ext/base/dcartesian-product/lib/dcartesianproduct.native.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ var addon = require( './../src/addon.node' );
3535
* @param {Float64Array} y - input array
3636
* @param {integer} strideY - stride length for `y`
3737
* @param {Float64Array} out - output array
38-
* @param {integer} LDO - stride of the leading dimension of `out`
38+
* @param {integer} LDO - stride length for the leading dimension of `out`
3939
* @returns {Float64Array} output array
4040
*
4141
* @example

lib/node_modules/@stdlib/blas/ext/base/dcartesian-product/lib/ndarray.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major' );
3939
* @param {integer} strideY - stride length for `y`
4040
* @param {NonNegativeInteger} offsetY - starting index for `y`
4141
* @param {Float64Array} out - output array
42-
* @param {integer} strideOut1 - stride length of the first dimension of `out`
43-
* @param {integer} strideOut2 - stride length of the second dimension of `out`
42+
* @param {integer} strideOut1 - stride length for the first dimension of `out`
43+
* @param {integer} strideOut2 - stride length for the second dimension of `out`
4444
* @param {NonNegativeInteger} offsetOut - starting index for `out`
4545
* @returns {Float64Array} output array
4646
*

lib/node_modules/@stdlib/blas/ext/base/dcartesian-product/lib/ndarray.native.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ var addon = require( './../src/addon.node' );
3939
* @param {integer} strideY - stride length for `y`
4040
* @param {NonNegativeInteger} offsetY - starting index for `y`
4141
* @param {Float64Array} out - output array
42-
* @param {integer} strideOut1 - stride length of the first dimension of `out`
43-
* @param {integer} strideOut2 - stride length of the second dimension of `out`
42+
* @param {integer} strideOut1 - stride length for the first dimension of `out`
43+
* @param {integer} strideOut2 - stride length for the second dimension of `out`
4444
* @param {NonNegativeInteger} offsetOut - starting index for `out`
4545
* @returns {Float64Array} output array
4646
*

lib/node_modules/@stdlib/blas/ext/base/dcartesian-product/src/main.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
* @param Y second input array
3232
* @param strideY stride length for Y
3333
* @param Out output array
34-
* @param LDO stride of the leading dimension of Out
34+
* @param LDO stride length for the leading dimension of Out
3535
*/
3636
void API_SUFFIX(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 ) {
3737
CBLAS_INT ox = stdlib_strided_stride2offset( M, strideX );
@@ -52,8 +52,8 @@ void API_SUFFIX(stdlib_strided_dcartesian_product)( const CBLAS_INT M, const CBL
5252
* @param strideY stride length for Y
5353
* @param offsetY starting index for Y
5454
* @param Out output array
55-
* @param strideOut1 stride length of the first dimension of Out
56-
* @param strideOut2 stride length of the second dimension of Out
55+
* @param strideOut1 stride length for the first dimension of Out
56+
* @param strideOut2 stride length for the second dimension of Out
5757
* @param offsetOut starting index for Out
5858
*/
5959
void API_SUFFIX(stdlib_strided_dcartesian_product_ndarray)( const CBLAS_INT M, const CBLAS_INT N, const double *X, const CBLAS_INT strideX, const CBLAS_INT offsetX, const double *Y, const CBLAS_INT strideY, const CBLAS_INT offsetY, double *Out, const CBLAS_INT strideOut1, const CBLAS_INT strideOut2, const CBLAS_INT offsetOut ) {

0 commit comments

Comments
 (0)