Skip to content

Commit 9bc10d4

Browse files
committed
fix: use resolved order when computing loop variables
--- 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 ccc7890 commit 9bc10d4

File tree

19 files changed

+77
-75
lines changed

19 files changed

+77
-75
lines changed

lib/node_modules/@stdlib/ndarray/base/unary-reduce-subarray/lib/10d.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222

2323
// MODULES //
2424

25-
var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major-string' );
2625
var incrementOffsets = require( './increment_offsets.js' );
2726
var setViewOffsets = require( './set_view_offsets.js' );
2827
var offsets = require( './offsets.js' );
@@ -38,6 +37,7 @@ var offsets = require( './offsets.js' );
3837
* @param {Array<Object>} arrays - ndarrays
3938
* @param {Array<Object>} views - initialized ndarray-like objects representing sub-array views
4039
* @param {IntegerArray} strides - loop dimension strides for the input ndarray
40+
* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order
4141
* @param {Options} opts - function options
4242
* @returns {void}
4343
*
@@ -96,12 +96,12 @@ var offsets = require( './offsets.js' );
9696
* ];
9797
*
9898
* // Perform a reduction:
99-
* unary10d( base, [ x, y ], views, [ 12, 12, 12, 12, 12, 12, 12, 12, 12, 4 ], {} );
99+
* unary10d( base, [ x, y ], views, [ 12, 12, 12, 12, 12, 12, 12, 12, 12, 4 ], true, {} );
100100
*
101101
* var arr = ndarray2array( y.data, y.shape, y.strides, y.offset, y.order );
102102
* // returns [ [ [ [ [ [ [ [ [ [ true, false, true ] ] ] ] ] ] ] ] ] ]
103103
*/
104-
function unary10d( fcn, arrays, views, strides, opts ) { // eslint-disable-line max-statements
104+
function unary10d( fcn, arrays, views, strides, isRowMajor, opts ) { // eslint-disable-line max-statements
105105
var ybuf;
106106
var dv0;
107107
var dv1;
@@ -146,7 +146,7 @@ function unary10d( fcn, arrays, views, strides, opts ) { // eslint-disable-line
146146
sh = y.shape;
147147

148148
// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...
149-
if ( isRowMajor( y.order ) ) {
149+
if ( isRowMajor ) {
150150
// For row-major ndarrays, the last dimensions have the fastest changing indices...
151151
S0 = sh[ 9 ];
152152
S1 = sh[ 8 ];

lib/node_modules/@stdlib/ndarray/base/unary-reduce-subarray/lib/10d_accessors.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222

2323
// MODULES //
2424

25-
var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major-string' );
2625
var incrementOffsets = require( './increment_offsets.js' );
2726
var setViewOffsets = require( './set_view_offsets.js' );
2827
var offsets = require( './offsets.js' );
@@ -38,6 +37,7 @@ var offsets = require( './offsets.js' );
3837
* @param {Array<Object>} arrays - ndarrays
3938
* @param {Array<Object>} views - initialized ndarray-like objects representing sub-array views
4039
* @param {IntegerArray} strides - loop dimension strides for the input ndarray
40+
* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order
4141
* @param {Options} opts - function options
4242
* @returns {void}
4343
*
@@ -100,12 +100,12 @@ var offsets = require( './offsets.js' );
100100
* ];
101101
*
102102
* // Perform a reduction:
103-
* unary10d( base, [ x, y ], views, [ 12, 12, 12, 12, 12, 12, 12, 12, 12, 4 ], {} );
103+
* unary10d( base, [ x, y ], views, [ 12, 12, 12, 12, 12, 12, 12, 12, 12, 4 ], true, {} );
104104
*
105105
* var arr = ndarray2array( y.data, y.shape, y.strides, y.offset, y.order );
106106
* // returns [ [ [ [ [ [ [ [ [ [ true, false, true ] ] ] ] ] ] ] ] ] ]
107107
*/
108-
function unary10d( fcn, arrays, views, strides, opts ) { // eslint-disable-line max-statements
108+
function unary10d( fcn, arrays, views, strides, isRowMajor, opts ) { // eslint-disable-line max-statements
109109
var ybuf;
110110
var set;
111111
var dv0;
@@ -151,7 +151,7 @@ function unary10d( fcn, arrays, views, strides, opts ) { // eslint-disable-line
151151
sh = y.shape;
152152

153153
// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...
154-
if ( isRowMajor( y.order ) ) {
154+
if ( isRowMajor ) {
155155
// For row-major ndarrays, the last dimensions have the fastest changing indices...
156156
S0 = sh[ 9 ];
157157
S1 = sh[ 8 ];

lib/node_modules/@stdlib/ndarray/base/unary-reduce-subarray/lib/2d.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020

2121
// MODULES //
2222

23-
var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major-string' );
2423
var incrementOffsets = require( './increment_offsets.js' );
2524
var setViewOffsets = require( './set_view_offsets.js' );
2625
var offsets = require( './offsets.js' );
@@ -36,6 +35,7 @@ var offsets = require( './offsets.js' );
3635
* @param {Array<Object>} arrays - ndarrays
3736
* @param {Array<Object>} views - initialized ndarray-like objects representing sub-array views
3837
* @param {IntegerArray} strides - loop dimension strides for the input ndarray
38+
* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order
3939
* @param {Options} opts - function options
4040
* @returns {void}
4141
*
@@ -94,12 +94,12 @@ var offsets = require( './offsets.js' );
9494
* ];
9595
*
9696
* // Perform a reduction:
97-
* unary2d( base, [ x, y ], views, [ 12, 4 ], {} );
97+
* unary2d( base, [ x, y ], views, [ 12, 4 ], true, {} );
9898
*
9999
* var arr = ndarray2array( y.data, y.shape, y.strides, y.offset, y.order );
100100
* // returns [ [ true, false, true ] ]
101101
*/
102-
function unary2d( fcn, arrays, views, strides, opts ) {
102+
function unary2d( fcn, arrays, views, strides, isRowMajor, opts ) {
103103
var ybuf;
104104
var dv0;
105105
var dv1;
@@ -120,7 +120,7 @@ function unary2d( fcn, arrays, views, strides, opts ) {
120120
sh = y.shape;
121121

122122
// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...
123-
if ( isRowMajor( y.order ) ) {
123+
if ( isRowMajor ) {
124124
// For row-major ndarrays, the last dimensions have the fastest changing indices...
125125
S0 = sh[ 1 ];
126126
S1 = sh[ 0 ];

lib/node_modules/@stdlib/ndarray/base/unary-reduce-subarray/lib/2d_accessors.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020

2121
// MODULES //
2222

23-
var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major-string' );
2423
var incrementOffsets = require( './increment_offsets.js' );
2524
var setViewOffsets = require( './set_view_offsets.js' );
2625
var offsets = require( './offsets.js' );
@@ -36,6 +35,7 @@ var offsets = require( './offsets.js' );
3635
* @param {Array<Object>} arrays - ndarrays
3736
* @param {Array<Object>} views - initialized ndarray-like objects representing sub-array views
3837
* @param {IntegerArray} strides - loop dimension strides for the input ndarray
38+
* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order
3939
* @param {Options} opts - function options
4040
* @returns {void}
4141
*
@@ -98,12 +98,12 @@ var offsets = require( './offsets.js' );
9898
* ];
9999
*
100100
* // Perform a reduction:
101-
* unary2d( base, [ x, y ], views, [ 12, 4 ], {} );
101+
* unary2d( base, [ x, y ], views, [ 12, 4 ], true, {} );
102102
*
103103
* var arr = ndarray2array( y.data, y.shape, y.strides, y.offset, y.order );
104104
* // returns [ [ true, false, true ] ]
105105
*/
106-
function unary2d( fcn, arrays, views, strides, opts ) {
106+
function unary2d( fcn, arrays, views, strides, isRowMajor, opts ) {
107107
var ybuf;
108108
var set;
109109
var dv0;
@@ -125,7 +125,7 @@ function unary2d( fcn, arrays, views, strides, opts ) {
125125
sh = y.shape;
126126

127127
// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...
128-
if ( isRowMajor( y.order ) ) {
128+
if ( isRowMajor ) {
129129
// For row-major ndarrays, the last dimensions have the fastest changing indices...
130130
S0 = sh[ 1 ];
131131
S1 = sh[ 0 ];

lib/node_modules/@stdlib/ndarray/base/unary-reduce-subarray/lib/3d.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020

2121
// MODULES //
2222

23-
var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major-string' );
2423
var incrementOffsets = require( './increment_offsets.js' );
2524
var setViewOffsets = require( './set_view_offsets.js' );
2625
var offsets = require( './offsets.js' );
@@ -36,6 +35,7 @@ var offsets = require( './offsets.js' );
3635
* @param {Array<Object>} arrays - ndarrays
3736
* @param {Array<Object>} views - initialized ndarray-like objects representing sub-array views
3837
* @param {IntegerArray} strides - loop dimension strides for the input ndarray
38+
* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order
3939
* @param {Options} opts - function options
4040
* @returns {void}
4141
*
@@ -94,12 +94,12 @@ var offsets = require( './offsets.js' );
9494
* ];
9595
*
9696
* // Perform a reduction:
97-
* unary3d( base, [ x, y ], views, [ 12, 12, 4 ], {} );
97+
* unary3d( base, [ x, y ], views, [ 12, 12, 4 ], true, {} );
9898
*
9999
* var arr = ndarray2array( y.data, y.shape, y.strides, y.offset, y.order );
100100
* // returns [ [ [ true, false, true ] ] ]
101101
*/
102-
function unary3d( fcn, arrays, views, strides, opts ) {
102+
function unary3d( fcn, arrays, views, strides, isRowMajor, opts ) {
103103
var ybuf;
104104
var dv0;
105105
var dv1;
@@ -123,7 +123,7 @@ function unary3d( fcn, arrays, views, strides, opts ) {
123123
sh = y.shape;
124124

125125
// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...
126-
if ( isRowMajor( y.order ) ) {
126+
if ( isRowMajor ) {
127127
// For row-major ndarrays, the last dimensions have the fastest changing indices...
128128
S0 = sh[ 2 ];
129129
S1 = sh[ 1 ];

lib/node_modules/@stdlib/ndarray/base/unary-reduce-subarray/lib/3d_accessors.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020

2121
// MODULES //
2222

23-
var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major-string' );
2423
var incrementOffsets = require( './increment_offsets.js' );
2524
var setViewOffsets = require( './set_view_offsets.js' );
2625
var offsets = require( './offsets.js' );
@@ -36,6 +35,7 @@ var offsets = require( './offsets.js' );
3635
* @param {Array<Object>} arrays - ndarrays
3736
* @param {Array<Object>} views - initialized ndarray-like objects representing sub-array views
3837
* @param {IntegerArray} strides - loop dimension strides for the input ndarray
38+
* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order
3939
* @param {Options} opts - function options
4040
* @returns {void}
4141
*
@@ -98,12 +98,12 @@ var offsets = require( './offsets.js' );
9898
* ];
9999
*
100100
* // Perform a reduction:
101-
* unary3d( base, [ x, y ], views, [ 12, 12, 4 ], {} );
101+
* unary3d( base, [ x, y ], views, [ 12, 12, 4 ], true, {} );
102102
*
103103
* var arr = ndarray2array( y.data, y.shape, y.strides, y.offset, y.order );
104104
* // returns [ [ [ true, false, true ] ] ]
105105
*/
106-
function unary3d( fcn, arrays, views, strides, opts ) {
106+
function unary3d( fcn, arrays, views, strides, isRowMajor, opts ) {
107107
var ybuf;
108108
var set;
109109
var dv0;
@@ -128,7 +128,7 @@ function unary3d( fcn, arrays, views, strides, opts ) {
128128
sh = y.shape;
129129

130130
// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...
131-
if ( isRowMajor( y.order ) ) {
131+
if ( isRowMajor ) {
132132
// For row-major ndarrays, the last dimensions have the fastest changing indices...
133133
S0 = sh[ 2 ];
134134
S1 = sh[ 1 ];

lib/node_modules/@stdlib/ndarray/base/unary-reduce-subarray/lib/4d.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020

2121
// MODULES //
2222

23-
var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major-string' );
2423
var incrementOffsets = require( './increment_offsets.js' );
2524
var setViewOffsets = require( './set_view_offsets.js' );
2625
var offsets = require( './offsets.js' );
@@ -36,6 +35,7 @@ var offsets = require( './offsets.js' );
3635
* @param {Array<Object>} arrays - ndarrays
3736
* @param {Array<Object>} views - initialized ndarray-like objects representing sub-array views
3837
* @param {IntegerArray} strides - loop dimension strides for the input ndarray
38+
* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order
3939
* @param {Options} opts - function options
4040
* @returns {void}
4141
*
@@ -94,12 +94,12 @@ var offsets = require( './offsets.js' );
9494
* ];
9595
*
9696
* // Perform a reduction:
97-
* unary4d( base, [ x, y ], views, [ 12, 12, 12, 4 ], {} );
97+
* unary4d( base, [ x, y ], views, [ 12, 12, 12, 4 ], true, {} );
9898
*
9999
* var arr = ndarray2array( y.data, y.shape, y.strides, y.offset, y.order );
100100
* // returns [ [ [ [ true, false, true ] ] ] ]
101101
*/
102-
function unary4d( fcn, arrays, views, strides, opts ) {
102+
function unary4d( fcn, arrays, views, strides, isRowMajor, opts ) {
103103
var ybuf;
104104
var dv0;
105105
var dv1;
@@ -126,7 +126,7 @@ function unary4d( fcn, arrays, views, strides, opts ) {
126126
sh = y.shape;
127127

128128
// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...
129-
if ( isRowMajor( y.order ) ) {
129+
if ( isRowMajor ) {
130130
// For row-major ndarrays, the last dimensions have the fastest changing indices...
131131
S0 = sh[ 3 ];
132132
S1 = sh[ 2 ];

lib/node_modules/@stdlib/ndarray/base/unary-reduce-subarray/lib/4d_accessors.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020

2121
// MODULES //
2222

23-
var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major-string' );
2423
var incrementOffsets = require( './increment_offsets.js' );
2524
var setViewOffsets = require( './set_view_offsets.js' );
2625
var offsets = require( './offsets.js' );
@@ -36,6 +35,7 @@ var offsets = require( './offsets.js' );
3635
* @param {Array<Object>} arrays - ndarrays
3736
* @param {Array<Object>} views - initialized ndarray-like objects representing sub-array views
3837
* @param {IntegerArray} strides - loop dimension strides for the input ndarray
38+
* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order
3939
* @param {Options} opts - function options
4040
* @returns {void}
4141
*
@@ -98,12 +98,12 @@ var offsets = require( './offsets.js' );
9898
* ];
9999
*
100100
* // Perform a reduction:
101-
* unary4d( base, [ x, y ], views, [ 12, 12, 12, 4 ], {} );
101+
* unary4d( base, [ x, y ], views, [ 12, 12, 12, 4 ], true, {} );
102102
*
103103
* var arr = ndarray2array( y.data, y.shape, y.strides, y.offset, y.order );
104104
* // returns [ [ [ [ true, false, true ] ] ] ]
105105
*/
106-
function unary4d( fcn, arrays, views, strides, opts ) {
106+
function unary4d( fcn, arrays, views, strides, isRowMajor, opts ) {
107107
var ybuf;
108108
var set;
109109
var dv0;
@@ -131,7 +131,7 @@ function unary4d( fcn, arrays, views, strides, opts ) {
131131
sh = y.shape;
132132

133133
// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...
134-
if ( isRowMajor( y.order ) ) {
134+
if ( isRowMajor ) {
135135
// For row-major ndarrays, the last dimensions have the fastest changing indices...
136136
S0 = sh[ 3 ];
137137
S1 = sh[ 2 ];

lib/node_modules/@stdlib/ndarray/base/unary-reduce-subarray/lib/5d.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020

2121
// MODULES //
2222

23-
var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major-string' );
2423
var incrementOffsets = require( './increment_offsets.js' );
2524
var setViewOffsets = require( './set_view_offsets.js' );
2625
var offsets = require( './offsets.js' );
@@ -36,6 +35,7 @@ var offsets = require( './offsets.js' );
3635
* @param {Array<Object>} arrays - ndarrays
3736
* @param {Array<Object>} views - initialized ndarray-like objects representing sub-array views
3837
* @param {IntegerArray} strides - loop dimension strides for the input ndarray
38+
* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order
3939
* @param {Options} opts - function options
4040
* @returns {void}
4141
*
@@ -94,12 +94,12 @@ var offsets = require( './offsets.js' );
9494
* ];
9595
*
9696
* // Perform a reduction:
97-
* unary5d( base, [ x, y ], views, [ 12, 12, 12, 12, 4 ], {} );
97+
* unary5d( base, [ x, y ], views, [ 12, 12, 12, 12, 4 ], true, {} );
9898
*
9999
* var arr = ndarray2array( y.data, y.shape, y.strides, y.offset, y.order );
100100
* // returns [ [ [ [ [ true, false, true ] ] ] ] ]
101101
*/
102-
function unary5d( fcn, arrays, views, strides, opts ) {
102+
function unary5d( fcn, arrays, views, strides, isRowMajor, opts ) {
103103
var ybuf;
104104
var dv0;
105105
var dv1;
@@ -129,7 +129,7 @@ function unary5d( fcn, arrays, views, strides, opts ) {
129129
sh = y.shape;
130130

131131
// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...
132-
if ( isRowMajor( y.order ) ) {
132+
if ( isRowMajor ) {
133133
// For row-major ndarrays, the last dimensions have the fastest changing indices...
134134
S0 = sh[ 4 ];
135135
S1 = sh[ 3 ];

lib/node_modules/@stdlib/ndarray/base/unary-reduce-subarray/lib/5d_accessors.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020

2121
// MODULES //
2222

23-
var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major-string' );
2423
var incrementOffsets = require( './increment_offsets.js' );
2524
var setViewOffsets = require( './set_view_offsets.js' );
2625
var offsets = require( './offsets.js' );
@@ -36,6 +35,7 @@ var offsets = require( './offsets.js' );
3635
* @param {Array<Object>} arrays - ndarrays
3736
* @param {Array<Object>} views - initialized ndarray-like objects representing sub-array views
3837
* @param {IntegerArray} strides - loop dimension strides for the input ndarray
38+
* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order
3939
* @param {Options} opts - function options
4040
* @returns {void}
4141
*
@@ -98,12 +98,12 @@ var offsets = require( './offsets.js' );
9898
* ];
9999
*
100100
* // Perform a reduction:
101-
* unary5d( base, [ x, y ], views, [ 12, 12, 12, 12, 4 ], {} );
101+
* unary5d( base, [ x, y ], views, [ 12, 12, 12, 12, 4 ], true, {} );
102102
*
103103
* var arr = ndarray2array( y.data, y.shape, y.strides, y.offset, y.order );
104104
* // returns [ [ [ [ [ true, false, true ] ] ] ] ]
105105
*/
106-
function unary5d( fcn, arrays, views, strides, opts ) {
106+
function unary5d( fcn, arrays, views, strides, isRowMajor, opts ) {
107107
var ybuf;
108108
var set;
109109
var dv0;
@@ -134,7 +134,7 @@ function unary5d( fcn, arrays, views, strides, opts ) {
134134
sh = y.shape;
135135

136136
// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...
137-
if ( isRowMajor( y.order ) ) {
137+
if ( isRowMajor ) {
138138
// For row-major ndarrays, the last dimensions have the fastest changing indices...
139139
S0 = sh[ 4 ];
140140
S1 = sh[ 3 ];

0 commit comments

Comments
 (0)