Skip to content

Commit 30d19ac

Browse files
committed
refactor: rename variables and align array elements
--- 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 106838e commit 30d19ac

File tree

6 files changed

+202
-82
lines changed

6 files changed

+202
-82
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ var without = require( '@stdlib/array/base/without' );
3131
* @private
3232
* @param {Function} fcn - wrapper for a one-dimensional strided array reduction function
3333
* @param {Array<Object>} arrays - ndarrays
34-
* @param {Function} strategy1 - first input ndarray reshape strategy
35-
* @param {Function} strategy2 - second input ndarray reshape strategy
34+
* @param {Function} strategyX - first input ndarray reshape strategy
35+
* @param {Function} strategyY - second input ndarray reshape strategy
3636
* @param {Options} opts - function options
3737
* @returns {void}
3838
*
@@ -106,9 +106,9 @@ var without = require( '@stdlib/array/base/without' );
106106
* var v = z.data;
107107
* // returns <Float64Array>[ 30.0 ]
108108
*/
109-
function binary0d( fcn, arrays, strategy1, strategy2, opts ) {
110-
arrays[ 0 ] = strategy1( arrays[ 0 ] );
111-
arrays[ 1 ] = strategy2( arrays[ 1 ] );
109+
function binary0d( fcn, arrays, strategyX, strategyY, opts ) {
110+
arrays[ 0 ] = strategyX( arrays[ 0 ] );
111+
arrays[ 1 ] = strategyY( arrays[ 1 ] );
112112
arrays[ 2 ].data[ arrays[ 2 ].offset ] = fcn( without( arrays, 2 ), opts );
113113
}
114114

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ var without = require( '@stdlib/array/base/without' );
3131
* @private
3232
* @param {Function} fcn - wrapper for a one-dimensional strided array reduction function
3333
* @param {Array<Object>} arrays - ndarrays
34-
* @param {Function} strategy1 - first input ndarray reshape strategy
35-
* @param {Function} strategy2 - second input ndarray reshape strategy
34+
* @param {Function} strategyX - first input ndarray reshape strategy
35+
* @param {Function} strategyY - second input ndarray reshape strategy
3636
* @param {Options} opts - function options
3737
* @returns {void}
3838
*
@@ -111,10 +111,10 @@ var without = require( '@stdlib/array/base/without' );
111111
* var v = z.data.get( 0 );
112112
* // returns 30.0
113113
*/
114-
function binary0d( fcn, arrays, strategy1, strategy2, opts ) {
114+
function binary0d( fcn, arrays, strategyX, strategyY, opts ) {
115115
var z = arrays[ 2 ];
116-
arrays[ 0 ] = strategy1( arrays[ 0 ] );
117-
arrays[ 1 ] = strategy2( arrays[ 1 ] );
116+
arrays[ 0 ] = strategyX( arrays[ 0 ] );
117+
arrays[ 1 ] = strategyY( arrays[ 1 ] );
118118
z.accessors[ 1 ]( z.data, z.offset, fcn( without( arrays, 2 ), opts ) );
119119
}
120120

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

Lines changed: 88 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* limitations under the License.
1717
*/
1818

19-
/* eslint-disable max-depth, max-len, max-statements */
19+
/* eslint-disable max-depth, max-len, max-statements, max-lines-per-function */
2020

2121
'use strict';
2222

@@ -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 binary10d( fcn, arrays, views, strideX, strideY, isRowMajor, strategy1, strategy2, opts ) {
139+
function binary10d( fcn, arrays, views, stridesX, stridesY, isRowMajor, strategyX, strategyY, opts ) {
140140
var zbuf;
141141
var dv0;
142142
var dv1;
@@ -194,16 +194,46 @@ function binary10d( fcn, arrays, views, strideX, strideY, isRowMajor, strategy1,
194194
S7 = sh[ 2 ];
195195
S8 = sh[ 1 ];
196196
S9 = sh[ 0 ];
197-
dv0 = [ strideX[9], strideY[9] ]; // offset increment for innermost loop
198-
dv1 = [ strideX[8] - ( S0*strideX[9] ), strideY[8] - ( S0*strideY[9] ) ];
199-
dv2 = [ strideX[7] - ( S1*strideX[8] ), strideY[7] - ( S1*strideY[8] ) ];
200-
dv3 = [ strideX[6] - ( S2*strideX[7] ), strideY[6] - ( S2*strideY[7] ) ];
201-
dv4 = [ strideX[5] - ( S3*strideX[6] ), strideY[5] - ( S3*strideY[6] ) ];
202-
dv5 = [ strideX[4] - ( S4*strideX[5] ), strideY[4] - ( S4*strideY[5] ) ];
203-
dv6 = [ strideX[3] - ( S5*strideX[4] ), strideY[3] - ( S5*strideY[4] ) ];
204-
dv7 = [ strideX[2] - ( S6*strideX[3] ), strideY[2] - ( S6*strideY[3] ) ];
205-
dv8 = [ strideX[1] - ( S7*strideX[2] ), strideY[1] - ( S7*strideY[2] ) ];
206-
dv9 = [ strideX[0] - ( S8*strideX[1] ), strideY[0] - ( S8*strideY[1] ) ]; // offset increment for outermost loop
197+
dv0 = [ // offset increment for innermost loop
198+
stridesX[9],
199+
stridesY[9]
200+
];
201+
dv1 = [
202+
stridesX[8] - ( S0*stridesX[9] ),
203+
stridesY[8] - ( S0*stridesY[9] )
204+
];
205+
dv2 = [
206+
stridesX[7] - ( S1*stridesX[8] ),
207+
stridesY[7] - ( S1*stridesY[8] )
208+
];
209+
dv3 = [
210+
stridesX[6] - ( S2*stridesX[7] ),
211+
stridesY[6] - ( S2*stridesY[7] )
212+
];
213+
dv4 = [
214+
stridesX[5] - ( S3*stridesX[6] ),
215+
stridesY[5] - ( S3*stridesY[6] )
216+
];
217+
dv5 = [
218+
stridesX[4] - ( S4*stridesX[5] ),
219+
stridesY[4] - ( S4*stridesY[5] )
220+
];
221+
dv6 = [
222+
stridesX[3] - ( S5*stridesX[4] ),
223+
stridesY[3] - ( S5*stridesY[4] )
224+
];
225+
dv7 = [
226+
stridesX[2] - ( S6*stridesX[3] ),
227+
stridesY[2] - ( S6*stridesY[3] )
228+
];
229+
dv8 = [
230+
stridesX[1] - ( S7*stridesX[2] ),
231+
stridesY[1] - ( S7*stridesY[2] )
232+
];
233+
dv9 = [ // offset increment for outermost loop
234+
stridesX[0] - ( S8*stridesX[1] ),
235+
stridesY[0] - ( S8*stridesY[1] )
236+
];
207237
for ( i = 2; i < arrays.length; i++ ) {
208238
sv = arrays[ i ].strides;
209239
dv0.push( sv[9] );
@@ -229,16 +259,46 @@ function binary10d( fcn, arrays, views, strideX, strideY, isRowMajor, strategy1,
229259
S7 = sh[ 7 ];
230260
S8 = sh[ 8 ];
231261
S9 = sh[ 9 ];
232-
dv0 = [ strideX[0], strideY[0] ]; // offset increment for innermost loop
233-
dv1 = [ strideX[1] - ( S0*strideX[0] ), strideY[1] - ( S0*strideY[0] ) ];
234-
dv2 = [ strideX[2] - ( S1*strideX[1] ), strideY[2] - ( S1*strideY[1] ) ];
235-
dv3 = [ strideX[3] - ( S2*strideX[2] ), strideY[3] - ( S2*strideY[2] ) ];
236-
dv4 = [ strideX[4] - ( S3*strideX[3] ), strideY[4] - ( S3*strideY[3] ) ];
237-
dv5 = [ strideX[5] - ( S4*strideX[4] ), strideY[5] - ( S4*strideY[4] ) ];
238-
dv6 = [ strideX[6] - ( S5*strideX[5] ), strideY[6] - ( S5*strideY[5] ) ];
239-
dv7 = [ strideX[7] - ( S6*strideX[6] ), strideY[7] - ( S6*strideY[6] ) ];
240-
dv8 = [ strideX[8] - ( S7*strideX[7] ), strideY[8] - ( S7*strideY[7] ) ];
241-
dv9 = [ strideX[9] - ( S8*strideX[8] ), strideY[9] - ( S8*strideY[8] ) ]; // offset increment for outermost loop
262+
dv0 = [ // offset increment for innermost loop
263+
stridesX[0],
264+
stridesY[0]
265+
];
266+
dv1 = [
267+
stridesX[1] - ( S0*stridesX[0] ),
268+
stridesY[1] - ( S0*stridesY[0] )
269+
];
270+
dv2 = [
271+
stridesX[2] - ( S1*stridesX[1] ),
272+
stridesY[2] - ( S1*stridesY[1] )
273+
];
274+
dv3 = [
275+
stridesX[3] - ( S2*stridesX[2] ),
276+
stridesY[3] - ( S2*stridesY[2] )
277+
];
278+
dv4 = [
279+
stridesX[4] - ( S3*stridesX[3] ),
280+
stridesY[4] - ( S3*stridesY[3] )
281+
];
282+
dv5 = [
283+
stridesX[5] - ( S4*stridesX[4] ),
284+
stridesY[5] - ( S4*stridesY[4] )
285+
];
286+
dv6 = [
287+
stridesX[6] - ( S5*stridesX[5] ),
288+
stridesY[6] - ( S5*stridesY[5] )
289+
];
290+
dv7 = [
291+
stridesX[7] - ( S6*stridesX[6] ),
292+
stridesY[7] - ( S6*stridesY[6] )
293+
];
294+
dv8 = [
295+
stridesX[8] - ( S7*stridesX[7] ),
296+
stridesY[8] - ( S7*stridesY[7] )
297+
];
298+
dv9 = [ // offset increment for outermost loop
299+
stridesX[9] - ( S8*stridesX[8] ),
300+
stridesY[9] - ( S8*stridesY[8] )
301+
];
242302
for ( i = 2; i < arrays.length; i++ ) {
243303
sv = arrays[ i ].strides;
244304
dv0.push( sv[0] );
@@ -274,8 +334,8 @@ function binary10d( fcn, arrays, views, strideX, strideY, isRowMajor, strategy1,
274334
for ( i1 = 0; i1 < S1; i1++ ) {
275335
for ( i0 = 0; i0 < S0; i0++ ) {
276336
setViewOffsets( views, iv );
277-
v[ 0 ] = strategy1( views[ 0 ] );
278-
v[ 1 ] = strategy2( views[ 1 ] );
337+
v[ 0 ] = strategyX( views[ 0 ] );
338+
v[ 1 ] = strategyY( views[ 1 ] );
279339
zbuf[ iv[2] ] = fcn( v, opts );
280340
incrementOffsets( iv, dv0 );
281341
}

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

Lines changed: 88 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* limitations under the License.
1717
*/
1818

19-
/* eslint-disable max-depth, max-len, max-statements */
19+
/* eslint-disable max-depth, max-len, max-statements, max-lines-per-function */
2020

2121
'use strict';
2222

@@ -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 binary10d( fcn, arrays, views, strideX, strideY, isRowMajor, strategy1, strategy2, opts ) {
144+
function binary10d( fcn, arrays, views, stridesX, stridesY, isRowMajor, strategyX, strategyY, opts ) {
145145
var zbuf;
146146
var set;
147147
var dv0;
@@ -200,16 +200,46 @@ function binary10d( fcn, arrays, views, strideX, strideY, isRowMajor, strategy1,
200200
S7 = sh[ 2 ];
201201
S8 = sh[ 1 ];
202202
S9 = sh[ 0 ];
203-
dv0 = [ strideX[9], strideY[9] ]; // offset increment for innermost loop
204-
dv1 = [ strideX[8] - ( S0*strideX[9] ), strideY[8] - ( S0*strideY[9] ) ];
205-
dv2 = [ strideX[7] - ( S1*strideX[8] ), strideY[7] - ( S1*strideY[8] ) ];
206-
dv3 = [ strideX[6] - ( S2*strideX[7] ), strideY[6] - ( S2*strideY[7] ) ];
207-
dv4 = [ strideX[5] - ( S3*strideX[6] ), strideY[5] - ( S3*strideY[6] ) ];
208-
dv5 = [ strideX[4] - ( S4*strideX[5] ), strideY[4] - ( S4*strideY[5] ) ];
209-
dv6 = [ strideX[3] - ( S5*strideX[4] ), strideY[3] - ( S5*strideY[4] ) ];
210-
dv7 = [ strideX[2] - ( S6*strideX[3] ), strideY[2] - ( S6*strideY[3] ) ];
211-
dv8 = [ strideX[1] - ( S7*strideX[2] ), strideY[1] - ( S7*strideY[2] ) ];
212-
dv9 = [ strideX[0] - ( S8*strideX[1] ), strideY[0] - ( S8*strideY[1] ) ]; // offset increment for outermost loop
203+
dv0 = [ // offset increment for innermost loop
204+
stridesX[9],
205+
stridesY[9]
206+
];
207+
dv1 = [
208+
stridesX[8] - ( S0*stridesX[9] ),
209+
stridesY[8] - ( S0*stridesY[9] )
210+
];
211+
dv2 = [
212+
stridesX[7] - ( S1*stridesX[8] ),
213+
stridesY[7] - ( S1*stridesY[8] )
214+
];
215+
dv3 = [
216+
stridesX[6] - ( S2*stridesX[7] ),
217+
stridesY[6] - ( S2*stridesY[7] )
218+
];
219+
dv4 = [
220+
stridesX[5] - ( S3*stridesX[6] ),
221+
stridesY[5] - ( S3*stridesY[6] )
222+
];
223+
dv5 = [
224+
stridesX[4] - ( S4*stridesX[5] ),
225+
stridesY[4] - ( S4*stridesY[5] )
226+
];
227+
dv6 = [
228+
stridesX[3] - ( S5*stridesX[4] ),
229+
stridesY[3] - ( S5*stridesY[4] )
230+
];
231+
dv7 = [
232+
stridesX[2] - ( S6*stridesX[3] ),
233+
stridesY[2] - ( S6*stridesY[3] )
234+
];
235+
dv8 = [
236+
stridesX[1] - ( S7*stridesX[2] ),
237+
stridesY[1] - ( S7*stridesY[2] )
238+
];
239+
dv9 = [ // offset increment for outermost loop
240+
stridesX[0] - ( S8*stridesX[1] ),
241+
stridesY[0] - ( S8*stridesY[1] )
242+
];
213243
for ( i = 2; i < arrays.length; i++ ) {
214244
sv = arrays[ i ].strides;
215245
dv0.push( sv[9] );
@@ -235,16 +265,46 @@ function binary10d( fcn, arrays, views, strideX, strideY, isRowMajor, strategy1,
235265
S7 = sh[ 7 ];
236266
S8 = sh[ 8 ];
237267
S9 = sh[ 9 ];
238-
dv0 = [ strideX[0], strideY[0] ]; // offset increment for innermost loop
239-
dv1 = [ strideX[1] - ( S0*strideX[0] ), strideY[1] - ( S0*strideY[0] ) ];
240-
dv2 = [ strideX[2] - ( S1*strideX[1] ), strideY[2] - ( S1*strideY[1] ) ];
241-
dv3 = [ strideX[3] - ( S2*strideX[2] ), strideY[3] - ( S2*strideY[2] ) ];
242-
dv4 = [ strideX[4] - ( S3*strideX[3] ), strideY[4] - ( S3*strideY[3] ) ];
243-
dv5 = [ strideX[5] - ( S4*strideX[4] ), strideY[5] - ( S4*strideY[4] ) ];
244-
dv6 = [ strideX[6] - ( S5*strideX[5] ), strideY[6] - ( S5*strideY[5] ) ];
245-
dv7 = [ strideX[7] - ( S6*strideX[6] ), strideY[7] - ( S6*strideY[6] ) ];
246-
dv8 = [ strideX[8] - ( S7*strideX[7] ), strideY[8] - ( S7*strideY[7] ) ];
247-
dv9 = [ strideX[9] - ( S8*strideX[8] ), strideY[9] - ( S8*strideY[8] ) ]; // offset increment for outermost loop
268+
dv0 = [ // offset increment for innermost loop
269+
stridesX[0],
270+
stridesY[0]
271+
];
272+
dv1 = [
273+
stridesX[1] - ( S0*stridesX[0] ),
274+
stridesY[1] - ( S0*stridesY[0] )
275+
];
276+
dv2 = [
277+
stridesX[2] - ( S1*stridesX[1] ),
278+
stridesY[2] - ( S1*stridesY[1] )
279+
];
280+
dv3 = [
281+
stridesX[3] - ( S2*stridesX[2] ),
282+
stridesY[3] - ( S2*stridesY[2] )
283+
];
284+
dv4 = [
285+
stridesX[4] - ( S3*stridesX[3] ),
286+
stridesY[4] - ( S3*stridesY[3] )
287+
];
288+
dv5 = [
289+
stridesX[5] - ( S4*stridesX[4] ),
290+
stridesY[5] - ( S4*stridesY[4] )
291+
];
292+
dv6 = [
293+
stridesX[6] - ( S5*stridesX[5] ),
294+
stridesY[6] - ( S5*stridesY[5] )
295+
];
296+
dv7 = [
297+
stridesX[7] - ( S6*stridesX[6] ),
298+
stridesY[7] - ( S6*stridesY[6] )
299+
];
300+
dv8 = [
301+
stridesX[8] - ( S7*stridesX[7] ),
302+
stridesY[8] - ( S7*stridesY[7] )
303+
];
304+
dv9 = [ // offset increment for outermost loop
305+
stridesX[9] - ( S8*stridesX[8] ),
306+
stridesY[9] - ( S8*stridesY[8] )
307+
];
248308
for ( i = 2; i < arrays.length; i++ ) {
249309
sv = arrays[ i ].strides;
250310
dv0.push( sv[0] );
@@ -283,8 +343,8 @@ function binary10d( fcn, arrays, views, strideX, strideY, isRowMajor, strategy1,
283343
for ( i1 = 0; i1 < S1; i1++ ) {
284344
for ( i0 = 0; i0 < S0; i0++ ) {
285345
setViewOffsets( views, iv );
286-
v[ 0 ] = strategy1( views[ 0 ] );
287-
v[ 1 ] = strategy2( views[ 1 ] );
346+
v[ 0 ] = strategyX( views[ 0 ] );
347+
v[ 1 ] = strategyY( views[ 1 ] );
288348
set( zbuf, iv[ 2 ], fcn( v, opts ) );
289349
incrementOffsets( iv, dv0 );
290350
}

0 commit comments

Comments
 (0)