Skip to content

Commit 18036a4

Browse files
committed
fix: use resolved order when determining increment offsets
--- 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 949c533 commit 18036a4

File tree

19 files changed

+74
-146
lines changed

19 files changed

+74
-146
lines changed

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

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

2121
'use strict';
2222

23-
// MODULES //
24-
25-
var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major-string' );
26-
27-
2823
// MAIN //
2924

3025
/**
@@ -52,6 +47,7 @@ var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major-string' );
5247
* @param {IntegerArray} z.strides - stride lengths
5348
* @param {NonNegativeInteger} z.offset - index offset
5449
* @param {string} z.order - specifies whether `z` is row-major (C-style) or column-major (Fortran-style)
50+
* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order
5551
* @param {Callback} fcn - binary callback
5652
* @returns {void}
5753
*
@@ -107,12 +103,12 @@ var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major-string' );
107103
* };
108104
*
109105
* // Apply the binary function:
110-
* binary10d( x, y, z, fcn );
106+
* binary10d( x, y, z, true, fcn );
111107
*
112108
* console.log( z.data );
113109
* // => <Float64Array>[ 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0 ]
114110
*/
115-
function binary10d( x, y, z, fcn ) {
111+
function binary10d( x, y, z, isRowMajor, fcn ) {
116112
var xbuf;
117113
var ybuf;
118114
var zbuf;
@@ -181,7 +177,7 @@ function binary10d( x, y, z, fcn ) {
181177
sx = x.strides;
182178
sy = y.strides;
183179
sz = z.strides;
184-
if ( isRowMajor( x.order ) ) {
180+
if ( isRowMajor ) {
185181
// For row-major ndarrays, the last dimensions have the fastest changing indices...
186182
S0 = sh[ 9 ];
187183
S1 = sh[ 8 ];

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

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

2121
'use strict';
2222

23-
// MODULES //
24-
25-
var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major-string' );
26-
27-
2823
// MAIN //
2924

3025
/**
@@ -55,6 +50,7 @@ var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major-string' );
5550
* @param {NonNegativeInteger} z.offset - index offset
5651
* @param {string} z.order - specifies whether `z` is row-major (C-style) or column-major (Fortran-style)
5752
* @param {Array<Function>} z.accessors - data buffer accessors
53+
* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order
5854
* @param {Callback} fcn - binary callback
5955
* @returns {void}
6056
*
@@ -115,12 +111,12 @@ var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major-string' );
115111
* };
116112
*
117113
* // Apply the binary function:
118-
* binary10d( x, y, z, fcn );
114+
* binary10d( x, y, z, true, fcn );
119115
*
120116
* console.log( copy( z.data ) );
121117
* // => [ 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0 ]
122118
*/
123-
function binary10d( x, y, z, fcn ) {
119+
function binary10d( x, y, z, isRowMajor, fcn ) {
124120
var xbuf;
125121
var ybuf;
126122
var zbuf;
@@ -192,7 +188,7 @@ function binary10d( x, y, z, fcn ) {
192188
sx = x.strides;
193189
sy = y.strides;
194190
sz = z.strides;
195-
if ( isRowMajor( x.order ) ) {
191+
if ( isRowMajor ) {
196192
// For row-major ndarrays, the last dimensions have the fastest changing indices...
197193
S0 = sh[ 9 ];
198194
S1 = sh[ 8 ];

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

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,6 @@
1818

1919
'use strict';
2020

21-
// MODULES //
22-
23-
var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major-string' );
24-
25-
2621
// MAIN //
2722

2823
/**
@@ -50,6 +45,7 @@ var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major-string' );
5045
* @param {IntegerArray} z.strides - stride lengths
5146
* @param {NonNegativeInteger} z.offset - index offset
5247
* @param {string} z.order - specifies whether `z` is row-major (C-style) or column-major (Fortran-style)
48+
* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order
5349
* @param {Callback} fcn - binary callback
5450
* @returns {void}
5551
*
@@ -105,12 +101,12 @@ var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major-string' );
105101
* };
106102
*
107103
* // Apply the binary function:
108-
* binary2d( x, y, z, fcn );
104+
* binary2d( x, y, z, true, fcn );
109105
*
110106
* console.log( z.data );
111107
* // => <Float64Array>[ 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0 ]
112108
*/
113-
function binary2d( x, y, z, fcn ) {
109+
function binary2d( x, y, z, isRowMajor, fcn ) {
114110
var xbuf;
115111
var ybuf;
116112
var zbuf;
@@ -139,7 +135,7 @@ function binary2d( x, y, z, fcn ) {
139135
sx = x.strides;
140136
sy = y.strides;
141137
sz = z.strides;
142-
if ( isRowMajor( x.order ) ) {
138+
if ( isRowMajor ) {
143139
// For row-major ndarrays, the last dimensions have the fastest changing indices...
144140
S0 = sh[ 1 ];
145141
S1 = sh[ 0 ];

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

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,6 @@
1818

1919
'use strict';
2020

21-
// MODULES //
22-
23-
var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major-string' );
24-
25-
2621
// MAIN //
2722

2823
/**
@@ -53,6 +48,7 @@ var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major-string' );
5348
* @param {NonNegativeInteger} z.offset - index offset
5449
* @param {string} z.order - specifies whether `z` is row-major (C-style) or column-major (Fortran-style)
5550
* @param {Array<Function>} z.accessors - data buffer accessors
51+
* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order
5652
* @param {Callback} fcn - binary callback
5753
* @returns {void}
5854
*
@@ -113,12 +109,12 @@ var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major-string' );
113109
* };
114110
*
115111
* // Apply the binary function:
116-
* binary2d( x, y, z, fcn );
112+
* binary2d( x, y, z, true, fcn );
117113
*
118114
* console.log( copy( z.data ) );
119115
* // => [ 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0 ]
120116
*/
121-
function binary2d( x, y, z, fcn ) {
117+
function binary2d( x, y, z, isRowMajor, fcn ) {
122118
var xbuf;
123119
var ybuf;
124120
var zbuf;
@@ -150,7 +146,7 @@ function binary2d( x, y, z, fcn ) {
150146
sx = x.strides;
151147
sy = y.strides;
152148
sz = z.strides;
153-
if ( isRowMajor( x.order ) ) {
149+
if ( isRowMajor ) {
154150
// For row-major ndarrays, the last dimensions have the fastest changing indices...
155151
S0 = sh[ 1 ];
156152
S1 = sh[ 0 ];

lib/node_modules/@stdlib/ndarray/base/binary/lib/3d.js

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,6 @@
1818

1919
'use strict';
2020

21-
// MODULES //
22-
23-
var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major-string' );
24-
25-
2621
// MAIN //
2722

2823
/**
@@ -50,6 +45,7 @@ var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major-string' );
5045
* @param {IntegerArray} z.strides - stride lengths
5146
* @param {NonNegativeInteger} z.offset - index offset
5247
* @param {string} z.order - specifies whether `z` is row-major (C-style) or column-major (Fortran-style)
48+
* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order
5349
* @param {Callback} fcn - binary callback
5450
* @returns {void}
5551
*
@@ -105,12 +101,12 @@ var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major-string' );
105101
* };
106102
*
107103
* // Apply the binary function:
108-
* binary3d( x, y, z, fcn );
104+
* binary3d( x, y, z, true, fcn );
109105
*
110106
* console.log( z.data );
111107
* // => <Float64Array>[ 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0 ]
112108
*/
113-
function binary3d( x, y, z, fcn ) {
109+
function binary3d( x, y, z, isRowMajor, fcn ) {
114110
var xbuf;
115111
var ybuf;
116112
var zbuf;
@@ -144,7 +140,7 @@ function binary3d( x, y, z, fcn ) {
144140
sx = x.strides;
145141
sy = y.strides;
146142
sz = z.strides;
147-
if ( isRowMajor( x.order ) ) {
143+
if ( isRowMajor ) {
148144
// For row-major ndarrays, the last dimensions have the fastest changing indices...
149145
S0 = sh[ 2 ];
150146
S1 = sh[ 1 ];

lib/node_modules/@stdlib/ndarray/base/binary/lib/3d_accessors.js

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,6 @@
1818

1919
'use strict';
2020

21-
// MODULES //
22-
23-
var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major-string' );
24-
25-
2621
// MAIN //
2722

2823
/**
@@ -53,6 +48,7 @@ var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major-string' );
5348
* @param {NonNegativeInteger} z.offset - index offset
5449
* @param {string} z.order - specifies whether `z` is row-major (C-style) or column-major (Fortran-style)
5550
* @param {Array<Function>} z.accessors - data buffer accessors
51+
* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order
5652
* @param {Callback} fcn - binary callback
5753
* @returns {void}
5854
*
@@ -113,12 +109,12 @@ var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major-string' );
113109
* };
114110
*
115111
* // Apply the binary function:
116-
* binary3d( x, y, z, fcn );
112+
* binary3d( x, y, z, true, fcn );
117113
*
118114
* console.log( copy( z.data ) );
119115
* // => [ 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0 ]
120116
*/
121-
function binary3d( x, y, z, fcn ) {
117+
function binary3d( x, y, z, isRowMajor, fcn ) {
122118
var xbuf;
123119
var ybuf;
124120
var zbuf;
@@ -155,7 +151,7 @@ function binary3d( x, y, z, fcn ) {
155151
sx = x.strides;
156152
sy = y.strides;
157153
sz = z.strides;
158-
if ( isRowMajor( x.order ) ) {
154+
if ( isRowMajor ) {
159155
// For row-major ndarrays, the last dimensions have the fastest changing indices...
160156
S0 = sh[ 2 ];
161157
S1 = sh[ 1 ];

lib/node_modules/@stdlib/ndarray/base/binary/lib/4d.js

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,6 @@
1818

1919
'use strict';
2020

21-
// MODULES //
22-
23-
var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major-string' );
24-
25-
2621
// MAIN //
2722

2823
/**
@@ -50,6 +45,7 @@ var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major-string' );
5045
* @param {IntegerArray} z.strides - stride lengths
5146
* @param {NonNegativeInteger} z.offset - index offset
5247
* @param {string} z.order - specifies whether `z` is row-major (C-style) or column-major (Fortran-style)
48+
* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order
5349
* @param {Callback} fcn - binary callback
5450
* @returns {void}
5551
*
@@ -105,12 +101,12 @@ var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major-string' );
105101
* };
106102
*
107103
* // Apply the binary function:
108-
* binary4d( x, y, z, fcn );
104+
* binary4d( x, y, z, true, fcn );
109105
*
110106
* console.log( z.data );
111107
* // => <Float64Array>[ 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0 ]
112108
*/
113-
function binary4d( x, y, z, fcn ) {
109+
function binary4d( x, y, z, isRowMajor, fcn ) {
114110
var xbuf;
115111
var ybuf;
116112
var zbuf;
@@ -149,7 +145,7 @@ function binary4d( x, y, z, fcn ) {
149145
sx = x.strides;
150146
sy = y.strides;
151147
sz = z.strides;
152-
if ( isRowMajor( x.order ) ) {
148+
if ( isRowMajor ) {
153149
// For row-major ndarrays, the last dimensions have the fastest changing indices...
154150
S0 = sh[ 3 ];
155151
S1 = sh[ 2 ];

lib/node_modules/@stdlib/ndarray/base/binary/lib/4d_accessors.js

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,6 @@
1818

1919
'use strict';
2020

21-
// MODULES //
22-
23-
var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major-string' );
24-
25-
2621
// MAIN //
2722

2823
/**
@@ -53,6 +48,7 @@ var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major-string' );
5348
* @param {NonNegativeInteger} z.offset - index offset
5449
* @param {string} z.order - specifies whether `z` is row-major (C-style) or column-major (Fortran-style)
5550
* @param {Array<Function>} z.accessors - data buffer accessors
51+
* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order
5652
* @param {Callback} fcn - binary callback
5753
* @returns {void}
5854
*
@@ -113,12 +109,12 @@ var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major-string' );
113109
* };
114110
*
115111
* // Apply the binary function:
116-
* binary4d( x, y, z, fcn );
112+
* binary4d( x, y, z, true, fcn );
117113
*
118114
* console.log( copy( z.data ) );
119115
* // => [ 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0 ]
120116
*/
121-
function binary4d( x, y, z, fcn ) {
117+
function binary4d( x, y, z, isRowMajor, fcn ) {
122118
var xbuf;
123119
var ybuf;
124120
var zbuf;
@@ -160,7 +156,7 @@ function binary4d( x, y, z, fcn ) {
160156
sx = x.strides;
161157
sy = y.strides;
162158
sz = z.strides;
163-
if ( isRowMajor( x.order ) ) {
159+
if ( isRowMajor ) {
164160
// For row-major ndarrays, the last dimensions have the fastest changing indices...
165161
S0 = sh[ 3 ];
166162
S1 = sh[ 2 ];

lib/node_modules/@stdlib/ndarray/base/binary/lib/5d.js

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

2121
'use strict';
2222

23-
// MODULES //
24-
25-
var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major-string' );
26-
27-
2823
// MAIN //
2924

3025
/**
@@ -52,6 +47,7 @@ var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major-string' );
5247
* @param {IntegerArray} z.strides - stride lengths
5348
* @param {NonNegativeInteger} z.offset - index offset
5449
* @param {string} z.order - specifies whether `z` is row-major (C-style) or column-major (Fortran-style)
50+
* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order
5551
* @param {Callback} fcn - binary callback
5652
* @returns {void}
5753
*
@@ -107,12 +103,12 @@ var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major-string' );
107103
* };
108104
*
109105
* // Apply the binary function:
110-
* binary5d( x, y, z, fcn );
106+
* binary5d( x, y, z, true, fcn );
111107
*
112108
* console.log( z.data );
113109
* // => <Float64Array>[ 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0 ]
114110
*/
115-
function binary5d( x, y, z, fcn ) {
111+
function binary5d( x, y, z, isRowMajor, fcn ) {
116112
var xbuf;
117113
var ybuf;
118114
var zbuf;
@@ -156,7 +152,7 @@ function binary5d( x, y, z, fcn ) {
156152
sx = x.strides;
157153
sy = y.strides;
158154
sz = z.strides;
159-
if ( isRowMajor( x.order ) ) {
155+
if ( isRowMajor ) {
160156
// For row-major ndarrays, the last dimensions have the fastest changing indices...
161157
S0 = sh[ 4 ];
162158
S1 = sh[ 3 ];

0 commit comments

Comments
 (0)