Skip to content

Commit 62ad65b

Browse files
committed
chore: apply suggested changes
--- 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: na - task: lint_package_json status: na - task: lint_repl_help status: na - 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: na - 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: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent 30d19ac commit 62ad65b

37 files changed

+992
-458
lines changed

lib/node_modules/@stdlib/ndarray/base/binary-reduce-strided1d/lib/1d.js

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ var offsets = require( './offsets.js' );
3737
* @param {Function} fcn - wrapper for a one-dimensional strided array reduction function
3838
* @param {Array<Object>} arrays - ndarrays
3939
* @param {Array<Object>} views - initialized ndarray-like objects representing sub-array views
40-
* @param {IntegerArray} strideX - loop dimension strides for the first input ndarray
41-
* @param {IntegerArray} strideY - loop dimension strides for the second input ndarray
42-
* @param {Function} strategy1 - first input ndarray reshape strategy
43-
* @param {Function} strategy2 - second input ndarray reshape strategy
40+
* @param {IntegerArray} stridesX - loop dimension strides for the first input ndarray
41+
* @param {IntegerArray} stridesY - loop dimension strides for the second input ndarray
42+
* @param {Function} strategyX - first input ndarray reshape strategy
43+
* @param {Function} strategyY - second input ndarray reshape strategy
4444
* @param {Options} opts - function options
4545
* @returns {void}
4646
*
@@ -135,7 +135,7 @@ var offsets = require( './offsets.js' );
135135
* var arr = ndarray2array( z.data, z.shape, z.strides, z.offset, z.order );
136136
* // returns [ 30.0, 174.0, 446.0 ]
137137
*/
138-
function binary1d( fcn, arrays, views, strideX, strideY, strategy1, strategy2, opts ) {
138+
function binary1d( fcn, arrays, views, stridesX, stridesY, strategyX, strategyY, opts ) {
139139
var zbuf;
140140
var dv0;
141141
var sh;
@@ -154,7 +154,10 @@ function binary1d( fcn, arrays, views, strideX, strideY, strategy1, strategy2, o
154154

155155
// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...
156156
S0 = sh[ 0 ];
157-
dv0 = [ strideX[0], strideY[0] ];
157+
dv0 = [
158+
stridesX[0],
159+
stridesY[0]
160+
];
158161
for ( i = 2; i < arrays.length; i++ ) {
159162
dv0.push( arrays[i].strides[0] );
160163
}
@@ -170,8 +173,8 @@ function binary1d( fcn, arrays, views, strideX, strideY, strategy1, strategy2, o
170173
// Iterate over the non-reduced ndarray dimensions...
171174
for ( i0 = 0; i0 < S0; i0++ ) {
172175
setViewOffsets( views, iv );
173-
v[ 0 ] = strategy1( views[ 0 ] );
174-
v[ 1 ] = strategy2( views[ 1 ] );
176+
v[ 0 ] = strategyX( views[ 0 ] );
177+
v[ 1 ] = strategyY( views[ 1 ] );
175178
zbuf[ iv[2] ] = fcn( v, opts );
176179
incrementOffsets( iv, dv0 );
177180
}

lib/node_modules/@stdlib/ndarray/base/binary-reduce-strided1d/lib/1d_accessors.js

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ var offsets = require( './offsets.js' );
3737
* @param {Function} fcn - wrapper for a one-dimensional strided array reduction function
3838
* @param {Array<Object>} arrays - ndarrays
3939
* @param {Array<Object>} views - initialized ndarray-like objects representing sub-array views
40-
* @param {IntegerArray} strideX - loop dimension strides for the first input ndarray
41-
* @param {IntegerArray} strideY - loop dimension strides for the second input ndarray
42-
* @param {Function} strategy1 - first input ndarray reshape strategy
43-
* @param {Function} strategy2 - second input ndarray reshape strategy
40+
* @param {IntegerArray} stridesX - loop dimension strides for the first input ndarray
41+
* @param {IntegerArray} stridesY - loop dimension strides for the second input ndarray
42+
* @param {Function} strategyX - first input ndarray reshape strategy
43+
* @param {Function} strategyY - second input ndarray reshape strategy
4444
* @param {Options} opts - function options
4545
* @returns {void}
4646
*
@@ -140,7 +140,7 @@ var offsets = require( './offsets.js' );
140140
* var arr = ndarray2array( z.data, z.shape, z.strides, z.offset, z.order );
141141
* // returns [ 30.0, 174.0, 446.0 ]
142142
*/
143-
function binary1d( fcn, arrays, views, strideX, strideY, strategy1, strategy2, opts ) {
143+
function binary1d( fcn, arrays, views, stridesX, stridesY, strategyX, strategyY, opts ) {
144144
var zbuf;
145145
var set;
146146
var dv0;
@@ -160,7 +160,10 @@ function binary1d( fcn, arrays, views, strideX, strideY, strategy1, strategy2, o
160160

161161
// Extract loop variables: dimensions and loop offset (pointer) increments...
162162
S0 = sh[ 0 ];
163-
dv0 = [ strideX[0], strideY[0] ];
163+
dv0 = [
164+
stridesX[0],
165+
stridesY[0]
166+
];
164167
for ( i = 2; i < arrays.length; i++ ) {
165168
dv0.push( arrays[i].strides[0] );
166169
}
@@ -179,8 +182,8 @@ function binary1d( fcn, arrays, views, strideX, strideY, strategy1, strategy2, o
179182
// Iterate over the non-reduced ndarray dimensions...
180183
for ( i0 = 0; i0 < S0; i0++ ) {
181184
setViewOffsets( views, iv );
182-
v[ 0 ] = strategy1( views[ 0 ] );
183-
v[ 1 ] = strategy2( views[ 1 ] );
185+
v[ 0 ] = strategyX( views[ 0 ] );
186+
v[ 1 ] = strategyY( views[ 1 ] );
184187
set( zbuf, iv[2], fcn( v, opts ) );
185188
incrementOffsets( iv, dv0 );
186189
}

lib/node_modules/@stdlib/ndarray/base/binary-reduce-strided1d/lib/2d.js

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ var offsets = require( './offsets.js' );
3737
* @param {Function} fcn - wrapper for a one-dimensional strided array reduction function
3838
* @param {Array<Object>} arrays - ndarrays
3939
* @param {Array<Object>} views - initialized ndarray-like objects representing sub-array views
40-
* @param {IntegerArray} strideX - loop dimension strides for the first input ndarray
41-
* @param {IntegerArray} strideY - loop dimension strides for the second input ndarray
40+
* @param {IntegerArray} stridesX - loop dimension strides for the first input ndarray
41+
* @param {IntegerArray} stridesY - loop dimension strides for the second input ndarray
4242
* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order
43-
* @param {Function} strategy1 - first input ndarray reshape strategy
44-
* @param {Function} strategy2 - second input ndarray reshape strategy
43+
* @param {Function} strategyX - first input ndarray reshape strategy
44+
* @param {Function} strategyY - second input ndarray reshape strategy
4545
* @param {Options} opts - function options
4646
* @returns {void}
4747
*
@@ -136,7 +136,7 @@ var offsets = require( './offsets.js' );
136136
* var arr = ndarray2array( z.data, z.shape, z.strides, z.offset, z.order );
137137
* // returns [ [ 30.0, 174.0, 446.0 ] ]
138138
*/
139-
function binary2d( fcn, arrays, views, strideX, strideY, isRowMajor, strategy1, strategy2, opts ) {
139+
function binary2d( fcn, arrays, views, stridesX, stridesY, isRowMajor, strategyX, strategyY, opts ) {
140140
var zbuf;
141141
var dv0;
142142
var dv1;
@@ -162,8 +162,14 @@ function binary2d( fcn, arrays, views, strideX, strideY, isRowMajor, strategy1,
162162
// For row-major ndarrays, the last dimensions have the fastest changing indices...
163163
S0 = sh[ 1 ];
164164
S1 = sh[ 0 ];
165-
dv0 = [ strideX[1], strideY[1] ]; // offset increment for innermost loop
166-
dv1 = [ strideX[0] - ( S0*strideX[1] ), strideY[0] - ( S0*strideY[1] ) ]; // offset increment for outermost loop
165+
dv0 = [ // offset increment for innermost loop
166+
stridesX[1],
167+
stridesY[1]
168+
];
169+
dv1 = [
170+
stridesX[0] - ( S0*stridesX[1] ),
171+
stridesY[0] - ( S0*stridesY[1] )
172+
]; // offset increment for outermost loop
167173
for ( i = 2; i < arrays.length; i++ ) {
168174
sv = arrays[ i ].strides;
169175
dv0.push( sv[1] );
@@ -173,8 +179,14 @@ function binary2d( fcn, arrays, views, strideX, strideY, isRowMajor, strategy1,
173179
// For column-major ndarrays, the first dimensions have the fastest changing indices...
174180
S0 = sh[ 0 ];
175181
S1 = sh[ 1 ];
176-
dv0 = [ strideX[0], strideY[0] ]; // offset increment for innermost loop
177-
dv1 = [ strideX[1] - ( S0*strideX[0] ), strideY[1] - ( S0*strideY[0] ) ]; // offset increment for outermost loop
182+
dv0 = [ // offset increment for innermost loop
183+
stridesX[0],
184+
stridesY[0]
185+
];
186+
dv1 = [
187+
stridesX[1] - ( S0*stridesX[0] ),
188+
stridesY[1] - ( S0*stridesY[0] )
189+
]; // offset increment for outermost loop
178190
for ( i = 2; i < arrays.length; i++ ) {
179191
sv = arrays[ i ].strides;
180192
dv0.push( sv[0] );
@@ -194,8 +206,8 @@ function binary2d( fcn, arrays, views, strideX, strideY, isRowMajor, strategy1,
194206
for ( i1 = 0; i1 < S1; i1++ ) {
195207
for ( i0 = 0; i0 < S0; i0++ ) {
196208
setViewOffsets( views, iv );
197-
v[ 0 ] = strategy1( views[ 0 ] );
198-
v[ 1 ] = strategy2( views[ 1 ] );
209+
v[ 0 ] = strategyX( views[ 0 ] );
210+
v[ 1 ] = strategyY( views[ 1 ] );
199211
zbuf[ iv[2] ] = fcn( v, opts );
200212
incrementOffsets( iv, dv0 );
201213
}

lib/node_modules/@stdlib/ndarray/base/binary-reduce-strided1d/lib/2d_accessors.js

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ var offsets = require( './offsets.js' );
3737
* @param {Function} fcn - wrapper for a one-dimensional strided array reduction function
3838
* @param {Array<Object>} arrays - ndarrays
3939
* @param {Array<Object>} views - initialized ndarray-like objects representing sub-array views
40-
* @param {IntegerArray} strideX - loop dimension strides for the first input ndarray
41-
* @param {IntegerArray} strideY - loop dimension strides for the second input ndarray
40+
* @param {IntegerArray} stridesX - loop dimension strides for the first input ndarray
41+
* @param {IntegerArray} stridesY - loop dimension strides for the second input ndarray
4242
* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order
43-
* @param {Function} strategy1 - first input ndarray reshape strategy
44-
* @param {Function} strategy2 - second input ndarray reshape strategy
43+
* @param {Function} strategyX - first input ndarray reshape strategy
44+
* @param {Function} strategyY - second input ndarray reshape strategy
4545
* @param {Options} opts - function options
4646
* @returns {void}
4747
*
@@ -141,7 +141,7 @@ var offsets = require( './offsets.js' );
141141
* var arr = ndarray2array( z.data, z.shape, z.strides, z.offset, z.order );
142142
* // returns [ [ 30.0, 174.0, 446.0 ] ]
143143
*/
144-
function binary2d( fcn, arrays, views, strideX, strideY, isRowMajor, strategy1, strategy2, opts ) {
144+
function binary2d( fcn, arrays, views, stridesX, stridesY, isRowMajor, strategyX, strategyY, opts ) {
145145
var zbuf;
146146
var set;
147147
var dv0;
@@ -168,8 +168,14 @@ function binary2d( fcn, arrays, views, strideX, strideY, isRowMajor, strategy1,
168168
// For row-major ndarrays, the last dimensions have the fastest changing indices...
169169
S0 = sh[ 1 ];
170170
S1 = sh[ 0 ];
171-
dv0 = [ strideX[1], strideY[1] ]; // offset increment for innermost loop
172-
dv1 = [ strideX[0] - ( S0*strideX[1] ), strideY[0] - ( S0*strideY[1] ) ]; // offset increment for outermost loop
171+
dv0 = [ // offset increment for innermost loop
172+
stridesX[1],
173+
stridesY[1]
174+
];
175+
dv1 = [
176+
stridesX[0] - ( S0*stridesX[1] ),
177+
stridesY[0] - ( S0*stridesY[1] )
178+
]; // offset increment for outermost loop
173179
for ( i = 2; i < arrays.length; i++ ) {
174180
sv = arrays[ i ].strides;
175181
dv0.push( sv[1] );
@@ -179,8 +185,14 @@ function binary2d( fcn, arrays, views, strideX, strideY, isRowMajor, strategy1,
179185
// For column-major ndarrays, the first dimensions have the fastest changing indices...
180186
S0 = sh[ 0 ];
181187
S1 = sh[ 1 ];
182-
dv0 = [ strideX[0], strideY[0] ]; // offset increment for innermost loop
183-
dv1 = [ strideX[1] - ( S0*strideX[0] ), strideY[1] - ( S0*strideY[0] ) ];// offset increment for outermost loop
188+
dv0 = [ // offset increment for innermost loop
189+
stridesX[0],
190+
stridesY[0]
191+
];
192+
dv1 = [
193+
stridesX[1] - ( S0*stridesX[0] ),
194+
stridesY[1] - ( S0*stridesY[0] )
195+
]; // offset increment for outermost loop
184196
for ( i = 2; i < arrays.length; i++ ) {
185197
sv = arrays[ i ].strides;
186198
dv0.push( sv[0] );
@@ -203,8 +215,8 @@ function binary2d( fcn, arrays, views, strideX, strideY, isRowMajor, strategy1,
203215
for ( i1 = 0; i1 < S1; i1++ ) {
204216
for ( i0 = 0; i0 < S0; i0++ ) {
205217
setViewOffsets( views, iv );
206-
v[ 0 ] = strategy1( views[ 0 ] );
207-
v[ 1 ] = strategy2( views[ 1 ] );
218+
v[ 0 ] = strategyX( views[ 0 ] );
219+
v[ 1 ] = strategyY( views[ 1 ] );
208220
set( zbuf, iv[ 2 ], fcn( v, opts ) );
209221
incrementOffsets( iv, dv0 );
210222
}

lib/node_modules/@stdlib/ndarray/base/binary-reduce-strided1d/lib/2d_blocked.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ var offsets = require( './offsets.js' );
4141
* @param {Function} fcn - wrapper for a one-dimensional strided array reduction function
4242
* @param {Array<Object>} arrays - ndarrays
4343
* @param {Array<Object>} views - initialized ndarray-like objects representing sub-array views
44-
* @param {IntegerArray} strideX - loop dimension strides for the first input ndarray
45-
* @param {IntegerArray} strideY - loop dimension strides for the second input ndarray
46-
* @param {Function} strategy1 - first input ndarray reshape strategy
47-
* @param {Function} strategy2 - second input ndarray reshape strategy
44+
* @param {IntegerArray} stridesX - loop dimension strides for the first input ndarray
45+
* @param {IntegerArray} stridesY - loop dimension strides for the second input ndarray
46+
* @param {Function} strategyX - first input ndarray reshape strategy
47+
* @param {Function} strategyY - second input ndarray reshape strategy
4848
* @param {Options} opts - function options
4949
* @returns {void}
5050
*
@@ -139,7 +139,7 @@ var offsets = require( './offsets.js' );
139139
* var arr = ndarray2array( z.data, z.shape, z.strides, z.offset, z.order );
140140
* // returns [ [ 30.0, 174.0, 446.0 ] ]
141141
*/
142-
function blockedbinary2d( fcn, arrays, views, strideX, strideY, strategy1, strategy2, opts ) {
142+
function blockedbinary2d( fcn, arrays, views, stridesX, stridesY, strategyX, strategyY, opts ) {
143143
var bsize;
144144
var zbuf;
145145
var dv0;
@@ -171,7 +171,7 @@ function blockedbinary2d( fcn, arrays, views, strideX, strideY, strategy1, strat
171171
z = arrays[ 2 ];
172172

173173
// Resolve the loop interchange order:
174-
o = loopOrder( z.shape, strideX, strideY, z.strides );
174+
o = loopOrder( z.shape, stridesX, stridesY, z.strides );
175175
sh = o.sh;
176176
sv = [ o.sx, o.sy, o.sz ];
177177
for ( k = 3; k < N; k++ ) {
@@ -228,8 +228,8 @@ function blockedbinary2d( fcn, arrays, views, strideX, strideY, strategy1, strat
228228
for ( i1 = 0; i1 < s1; i1++ ) {
229229
for ( i0 = 0; i0 < s0; i0++ ) {
230230
setViewOffsets( views, iv );
231-
v[ 0 ] = strategy1( views[ 0 ] );
232-
v[ 1 ] = strategy2( views[ 1 ] );
231+
v[ 0 ] = strategyX( views[ 0 ] );
232+
v[ 1 ] = strategyY( views[ 1 ] );
233233
zbuf[ iv[2] ] = fcn( v, opts );
234234
incrementOffsets( iv, dv0 );
235235
}

lib/node_modules/@stdlib/ndarray/base/binary-reduce-strided1d/lib/2d_blocked_accessors.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ var offsets = require( './offsets.js' );
4141
* @param {Function} fcn - wrapper for a one-dimensional strided array reduction function
4242
* @param {Array<Object>} arrays - ndarrays
4343
* @param {Array<Object>} views - initialized ndarray-like objects representing sub-array views
44-
* @param {IntegerArray} strideX - loop dimension strides for the first input ndarray
45-
* @param {IntegerArray} strideY - loop dimension strides for the second input ndarray
46-
* @param {Function} strategy1 - first input ndarray reshape strategy
47-
* @param {Function} strategy2 - second input ndarray reshape strategy
44+
* @param {IntegerArray} stridesX - loop dimension strides for the first input ndarray
45+
* @param {IntegerArray} stridesY - loop dimension strides for the second input ndarray
46+
* @param {Function} strategyX - first input ndarray reshape strategy
47+
* @param {Function} strategyY - second input ndarray reshape strategy
4848
* @param {Options} opts - function options
4949
* @returns {void}
5050
*
@@ -144,7 +144,7 @@ var offsets = require( './offsets.js' );
144144
* var arr = ndarray2array( z.data, z.shape, z.strides, z.offset, z.order );
145145
* // returns [ [ 30.0, 174.0, 446.0 ] ]
146146
*/
147-
function blockedbinary2d( fcn, arrays, views, strideX, strideY, strategy1, strategy2, opts ) {
147+
function blockedbinary2d( fcn, arrays, views, stridesX, stridesY, strategyX, strategyY, opts ) {
148148
var bsize;
149149
var zbuf;
150150
var set;
@@ -177,7 +177,7 @@ function blockedbinary2d( fcn, arrays, views, strideX, strideY, strategy1, strat
177177
z = arrays[ 2 ];
178178

179179
// Resolve the loop interchange order:
180-
o = loopOrder( z.shape, strideX, strideY, z.strides );
180+
o = loopOrder( z.shape, stridesX, stridesY, z.strides );
181181
sh = o.sh;
182182
sv = [ o.sx, o.sy, o.sz ];
183183
for ( k = 3; k < N; k++ ) {
@@ -237,8 +237,8 @@ function blockedbinary2d( fcn, arrays, views, strideX, strideY, strategy1, strat
237237
for ( i1 = 0; i1 < s1; i1++ ) {
238238
for ( i0 = 0; i0 < s0; i0++ ) {
239239
setViewOffsets( views, iv );
240-
v[ 0 ] = strategy1( views[ 0 ] );
241-
v[ 1 ] = strategy2( views[ 1 ] );
240+
v[ 0 ] = strategyX( views[ 0 ] );
241+
v[ 1 ] = strategyY( views[ 1 ] );
242242
set( zbuf, iv[ 2 ], fcn( v, opts ) );
243243
incrementOffsets( iv, dv0 );
244244
}

0 commit comments

Comments
 (0)