Skip to content

Commit ab22671

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 3ef5f68 commit ab22671

File tree

19 files changed

+77
-57
lines changed

19 files changed

+77
-57
lines changed

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
* @param {IntegerArray} y.strides - stride lengths
4141
* @param {NonNegativeInteger} y.offset - index offset
4242
* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)
43+
* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order
4344
* @returns {void}
4445
*
4546
* @example
@@ -79,12 +80,12 @@
7980
* };
8081
*
8182
* // Copy elements:
82-
* assign10d( x, y );
83+
* assign10d( x, y, true );
8384
*
8485
* console.log( y.data );
8586
* // => <Float64Array>[ 2.0, 3.0, 6.0, 7.0, 10.0, 11.0 ]
8687
*/
87-
function assign10d( x, y ) { // eslint-disable-line max-statements
88+
function assign10d( x, y, isRowMajor ) { // eslint-disable-line max-statements
8889
var xbuf;
8990
var ybuf;
9091
var dx0;
@@ -139,7 +140,7 @@ function assign10d( x, y ) { // eslint-disable-line max-statements
139140
sh = x.shape;
140141
sx = x.strides;
141142
sy = y.strides;
142-
if ( x.order === 'row-major' ) {
143+
if ( isRowMajor ) {
143144
// For row-major ndarrays, the last dimensions have the fastest changing indices...
144145
S0 = sh[ 9 ];
145146
S1 = sh[ 8 ];

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
* @param {NonNegativeInteger} y.offset - index offset
4343
* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)
4444
* @param {Array<Function>} y.accessors - data buffer accessors
45+
* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order
4546
* @returns {void}
4647
*
4748
* @example
@@ -95,7 +96,7 @@
9596
* };
9697
*
9798
* // Copy elements:
98-
* assign10d( x, y );
99+
* assign10d( x, y, true );
99100
*
100101
* var v = y.data.get( 0 );
101102
*
@@ -105,7 +106,7 @@
105106
* var im = imagf( v );
106107
* // returns 2.0
107108
*/
108-
function assign10d( x, y ) { // eslint-disable-line max-statements
109+
function assign10d( x, y, isRowMajor ) { // eslint-disable-line max-statements
109110
var xbuf;
110111
var ybuf;
111112
var get;
@@ -162,7 +163,7 @@ function assign10d( x, y ) { // eslint-disable-line max-statements
162163
sh = x.shape;
163164
sx = x.strides;
164165
sy = y.strides;
165-
if ( x.order === 'row-major' ) {
166+
if ( isRowMajor ) {
166167
// For row-major ndarrays, the last dimensions have the fastest changing indices...
167168
S0 = sh[ 9 ];
168169
S1 = sh[ 8 ];

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
* @param {IntegerArray} y.strides - stride lengths
3939
* @param {NonNegativeInteger} y.offset - index offset
4040
* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)
41+
* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order
4142
* @returns {void}
4243
*
4344
* @example
@@ -77,12 +78,12 @@
7778
* };
7879
*
7980
* // Copy elements:
80-
* assign2d( x, y );
81+
* assign2d( x, y, true );
8182
*
8283
* console.log( y.data );
8384
* // => <Float64Array>[ 2.0, 3.0, 6.0, 7.0 ]
8485
*/
85-
function assign2d( x, y ) {
86+
function assign2d( x, y, isRowMajor ) {
8687
var xbuf;
8788
var ybuf;
8889
var dx0;
@@ -105,7 +106,7 @@ function assign2d( x, y ) {
105106
sh = x.shape;
106107
sx = x.strides;
107108
sy = y.strides;
108-
if ( x.order === 'row-major' ) {
109+
if ( isRowMajor ) {
109110
// For row-major ndarrays, the last dimensions have the fastest changing indices...
110111
S0 = sh[ 1 ];
111112
S1 = sh[ 0 ];

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
* @param {NonNegativeInteger} y.offset - index offset
4141
* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)
4242
* @param {Array<Function>} y.accessors - data buffer accessors
43+
* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order
4344
* @returns {void}
4445
*
4546
* @example
@@ -93,7 +94,7 @@
9394
* };
9495
*
9596
* // Copy elements:
96-
* assign2d( x, y );
97+
* assign2d( x, y, true );
9798
*
9899
* var v = y.data.get( 0 );
99100
*
@@ -103,7 +104,7 @@
103104
* var im = imagf( v );
104105
* // returns 2.0
105106
*/
106-
function assign2d( x, y ) {
107+
function assign2d( x, y, isRowMajor ) {
107108
var xbuf;
108109
var ybuf;
109110
var get;
@@ -128,7 +129,7 @@ function assign2d( x, y ) {
128129
sh = x.shape;
129130
sx = x.strides;
130131
sy = y.strides;
131-
if ( x.order === 'row-major' ) {
132+
if ( isRowMajor ) {
132133
// For row-major ndarrays, the last dimensions have the fastest changing indices...
133134
S0 = sh[ 1 ];
134135
S1 = sh[ 0 ];

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
* @param {IntegerArray} y.strides - stride lengths
3939
* @param {NonNegativeInteger} y.offset - index offset
4040
* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)
41+
* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order
4142
* @returns {void}
4243
*
4344
* @example
@@ -77,12 +78,12 @@
7778
* };
7879
*
7980
* // Copy elements:
80-
* assign3d( x, y );
81+
* assign3d( x, y, true );
8182
*
8283
* console.log( y.data );
8384
* // => <Float64Array>[ 2.0, 3.0, 6.0, 7.0, 10.0, 11.0 ]
8485
*/
85-
function assign3d( x, y ) {
86+
function assign3d( x, y, isRowMajor ) {
8687
var xbuf;
8788
var ybuf;
8889
var dx0;
@@ -109,7 +110,7 @@ function assign3d( x, y ) {
109110
sh = x.shape;
110111
sx = x.strides;
111112
sy = y.strides;
112-
if ( x.order === 'row-major' ) {
113+
if ( isRowMajor ) {
113114
// For row-major ndarrays, the last dimensions have the fastest changing indices...
114115
S0 = sh[ 2 ];
115116
S1 = sh[ 1 ];

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
* @param {NonNegativeInteger} y.offset - index offset
4141
* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)
4242
* @param {Array<Function>} y.accessors - data buffer accessors
43+
* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order
4344
* @returns {void}
4445
*
4546
* @example
@@ -93,7 +94,7 @@
9394
* };
9495
*
9596
* // Copy elements:
96-
* assign3d( x, y );
97+
* assign3d( x, y, true );
9798
*
9899
* var v = y.data.get( 0 );
99100
*
@@ -103,7 +104,7 @@
103104
* var im = imagf( v );
104105
* // returns 2.0
105106
*/
106-
function assign3d( x, y ) {
107+
function assign3d( x, y, isRowMajor ) {
107108
var xbuf;
108109
var ybuf;
109110
var get;
@@ -132,7 +133,7 @@ function assign3d( x, y ) {
132133
sh = x.shape;
133134
sx = x.strides;
134135
sy = y.strides;
135-
if ( x.order === 'row-major' ) {
136+
if ( isRowMajor ) {
136137
// For row-major ndarrays, the last dimensions have the fastest changing indices...
137138
S0 = sh[ 2 ];
138139
S1 = sh[ 1 ];

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
* @param {IntegerArray} y.strides - stride lengths
3939
* @param {NonNegativeInteger} y.offset - index offset
4040
* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)
41+
* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order
4142
* @returns {void}
4243
*
4344
* @example
@@ -77,12 +78,12 @@
7778
* };
7879
*
7980
* // Copy elements:
80-
* assign4d( x, y );
81+
* assign4d( x, y, true );
8182
*
8283
* console.log( y.data );
8384
* // => <Float64Array>[ 2.0, 3.0, 6.0, 7.0, 10.0, 11.0 ]
8485
*/
85-
function assign4d( x, y ) {
86+
function assign4d( x, y, isRowMajor ) {
8687
var xbuf;
8788
var ybuf;
8889
var dx0;
@@ -113,7 +114,7 @@ function assign4d( x, y ) {
113114
sh = x.shape;
114115
sx = x.strides;
115116
sy = y.strides;
116-
if ( x.order === 'row-major' ) {
117+
if ( isRowMajor ) {
117118
// For row-major ndarrays, the last dimensions have the fastest changing indices...
118119
S0 = sh[ 3 ];
119120
S1 = sh[ 2 ];

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
* @param {NonNegativeInteger} y.offset - index offset
4141
* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)
4242
* @param {Array<Function>} y.accessors - data buffer accessors
43+
* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order
4344
* @returns {void}
4445
*
4546
* @example
@@ -93,7 +94,7 @@
9394
* };
9495
*
9596
* // Copy elements:
96-
* assign4d( x, y );
97+
* assign4d( x, y, true );
9798
*
9899
* var v = y.data.get( 0 );
99100
*
@@ -103,7 +104,7 @@
103104
* var im = imagf( v );
104105
* // returns 2.0
105106
*/
106-
function assign4d( x, y ) {
107+
function assign4d( x, y, isRowMajor ) {
107108
var xbuf;
108109
var ybuf;
109110
var get;
@@ -136,7 +137,7 @@ function assign4d( x, y ) {
136137
sh = x.shape;
137138
sx = x.strides;
138139
sy = y.strides;
139-
if ( x.order === 'row-major' ) {
140+
if ( isRowMajor ) {
140141
// For row-major ndarrays, the last dimensions have the fastest changing indices...
141142
S0 = sh[ 3 ];
142143
S1 = sh[ 2 ];

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
* @param {IntegerArray} y.strides - stride lengths
3939
* @param {NonNegativeInteger} y.offset - index offset
4040
* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)
41+
* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order
4142
* @returns {void}
4243
*
4344
* @example
@@ -77,12 +78,12 @@
7778
* };
7879
*
7980
* // Copy elements:
80-
* assign5d( x, y );
81+
* assign5d( x, y, true );
8182
*
8283
* console.log( y.data );
8384
* // => <Float64Array>[ 2.0, 3.0, 6.0, 7.0, 10.0, 11.0 ]
8485
*/
85-
function assign5d( x, y ) {
86+
function assign5d( x, y, isRowMajor ) {
8687
var xbuf;
8788
var ybuf;
8889
var dx0;
@@ -117,7 +118,7 @@ function assign5d( x, y ) {
117118
sh = x.shape;
118119
sx = x.strides;
119120
sy = y.strides;
120-
if ( x.order === 'row-major' ) {
121+
if ( isRowMajor ) {
121122
// For row-major ndarrays, the last dimensions have the fastest changing indices...
122123
S0 = sh[ 4 ];
123124
S1 = sh[ 3 ];

lib/node_modules/@stdlib/ndarray/base/assign/lib/5d_accessors.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
* @param {NonNegativeInteger} y.offset - index offset
4141
* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)
4242
* @param {Array<Function>} y.accessors - data buffer accessors
43+
* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order
4344
* @returns {void}
4445
*
4546
* @example
@@ -93,7 +94,7 @@
9394
* };
9495
*
9596
* // Copy elements:
96-
* assign5d( x, y );
97+
* assign5d( x, y, true );
9798
*
9899
* var v = y.data.get( 0 );
99100
*
@@ -103,7 +104,7 @@
103104
* var im = imagf( v );
104105
* // returns 2.0
105106
*/
106-
function assign5d( x, y ) {
107+
function assign5d( x, y, isRowMajor ) {
107108
var xbuf;
108109
var ybuf;
109110
var get;
@@ -140,7 +141,7 @@ function assign5d( x, y ) {
140141
sh = x.shape;
141142
sx = x.strides;
142143
sy = y.strides;
143-
if ( x.order === 'row-major' ) {
144+
if ( isRowMajor ) {
144145
// For row-major ndarrays, the last dimensions have the fastest changing indices...
145146
S0 = sh[ 4 ];
146147
S1 = sh[ 3 ];

0 commit comments

Comments
 (0)