Skip to content

Commit b9e9eca

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 1e0917b commit b9e9eca

File tree

18 files changed

+108
-18
lines changed

18 files changed

+108
-18
lines changed

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@
2020

2121
'use strict';
2222

23+
// MODULES //
24+
25+
var strides2order = require( '@stdlib/ndarray/base/strides2order' );
26+
27+
2328
// MAIN //
2429

2530
/**
@@ -152,7 +157,7 @@ function unary10d( x, y, fcn, clbk, thisArg ) { // eslint-disable-line max-state
152157
sh = x.shape;
153158
sx = x.strides;
154159
sy = y.strides;
155-
if ( x.order === 'row-major' ) {
160+
if ( strides2order( sx ) === 1 ) {
156161
// For row-major ndarrays, the last dimensions have the fastest changing indices...
157162
S0 = sh[ 9 ];
158163
S1 = sh[ 8 ];

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@
2020

2121
'use strict';
2222

23+
// MODULES //
24+
25+
var strides2order = require( '@stdlib/ndarray/base/strides2order' );
26+
27+
2328
// MAIN //
2429

2530
/**
@@ -172,7 +177,7 @@ function unary10d( x, y, fcn, clbk, thisArg ) { // eslint-disable-line max-state
172177
sh = x.shape;
173178
sx = x.strides;
174179
sy = y.strides;
175-
if ( x.order === 'row-major' ) {
180+
if ( strides2order( sx ) === 1 ) {
176181
// For row-major ndarrays, the last dimensions have the fastest changing indices...
177182
S0 = sh[ 9 ];
178183
S1 = sh[ 8 ];

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@
1818

1919
'use strict';
2020

21+
// MODULES //
22+
23+
var strides2order = require( '@stdlib/ndarray/base/strides2order' );
24+
25+
2126
// MAIN //
2227

2328
/**
@@ -118,7 +123,7 @@ function unary2d( x, y, fcn, clbk, thisArg ) {
118123
sh = x.shape;
119124
sx = x.strides;
120125
sy = y.strides;
121-
if ( x.order === 'row-major' ) {
126+
if ( strides2order( sx ) === 1 ) {
122127
// For row-major ndarrays, the last dimensions have the fastest changing indices...
123128
S0 = sh[ 1 ];
124129
S1 = sh[ 0 ];

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@
1818

1919
'use strict';
2020

21+
// MODULES //
22+
23+
var strides2order = require( '@stdlib/ndarray/base/strides2order' );
24+
25+
2126
// MAIN //
2227

2328
/**
@@ -138,7 +143,7 @@ function unary2d( x, y, fcn, clbk, thisArg ) {
138143
sh = x.shape;
139144
sx = x.strides;
140145
sy = y.strides;
141-
if ( x.order === 'row-major' ) {
146+
if ( strides2order( sx ) === 1 ) {
142147
// For row-major ndarrays, the last dimensions have the fastest changing indices...
143148
S0 = sh[ 1 ];
144149
S1 = sh[ 0 ];

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@
1818

1919
'use strict';
2020

21+
// MODULES //
22+
23+
var strides2order = require( '@stdlib/ndarray/base/strides2order' );
24+
25+
2126
// MAIN //
2227

2328
/**
@@ -122,7 +127,7 @@ function unary3d( x, y, fcn, clbk, thisArg ) {
122127
sh = x.shape;
123128
sx = x.strides;
124129
sy = y.strides;
125-
if ( x.order === 'row-major' ) {
130+
if ( strides2order( sx ) === 1 ) {
126131
// For row-major ndarrays, the last dimensions have the fastest changing indices...
127132
S0 = sh[ 2 ];
128133
S1 = sh[ 1 ];

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@
2020

2121
'use strict';
2222

23+
// MODULES //
24+
25+
var strides2order = require( '@stdlib/ndarray/base/strides2order' );
26+
27+
2328
// MAIN //
2429

2530
/**
@@ -144,7 +149,7 @@ function unary3d( x, y, fcn, clbk, thisArg ) {
144149
sh = x.shape;
145150
sx = x.strides;
146151
sy = y.strides;
147-
if ( x.order === 'row-major' ) {
152+
if ( strides2order( sx ) === 1 ) {
148153
// For row-major ndarrays, the last dimensions have the fastest changing indices...
149154
S0 = sh[ 2 ];
150155
S1 = sh[ 1 ];

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@
2020

2121
/* eslint-disable max-len */
2222

23+
// MODULES //
24+
25+
var strides2order = require( '@stdlib/ndarray/base/strides2order' );
26+
27+
2328
// MAIN //
2429

2530
/**
@@ -128,7 +133,7 @@ function unary4d( x, y, fcn, clbk, thisArg ) {
128133
sh = x.shape;
129134
sx = x.strides;
130135
sy = y.strides;
131-
if ( x.order === 'row-major' ) {
136+
if ( strides2order( sx ) === 1 ) {
132137
// For row-major ndarrays, the last dimensions have the fastest changing indices...
133138
S0 = sh[ 3 ];
134139
S1 = sh[ 2 ];

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@
2020

2121
'use strict';
2222

23+
// MODULES //
24+
25+
var strides2order = require( '@stdlib/ndarray/base/strides2order' );
26+
27+
2328
// MAIN //
2429

2530
/**
@@ -148,7 +153,7 @@ function unary4d( x, y, fcn, clbk, thisArg ) {
148153
sh = x.shape;
149154
sx = x.strides;
150155
sy = y.strides;
151-
if ( x.order === 'row-major' ) {
156+
if ( strides2order( sx ) === 1 ) {
152157
// For row-major ndarrays, the last dimensions have the fastest changing indices...
153158
S0 = sh[ 3 ];
154159
S1 = sh[ 2 ];

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@
2020

2121
/* eslint-disable max-depth, max-len */
2222

23+
// MODULES //
24+
25+
var strides2order = require( '@stdlib/ndarray/base/strides2order' );
26+
27+
2328
// MAIN //
2429

2530
/**
@@ -132,7 +137,7 @@ function unary5d( x, y, fcn, clbk, thisArg ) {
132137
sh = x.shape;
133138
sx = x.strides;
134139
sy = y.strides;
135-
if ( x.order === 'row-major' ) {
140+
if ( strides2order( sx ) === 1 ) {
136141
// For row-major ndarrays, the last dimensions have the fastest changing indices...
137142
S0 = sh[ 4 ];
138143
S1 = sh[ 3 ];

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@
2020

2121
'use strict';
2222

23+
// MODULES //
24+
25+
var strides2order = require( '@stdlib/ndarray/base/strides2order' );
26+
27+
2328
// MAIN //
2429

2530
/**
@@ -152,7 +157,7 @@ function unary5d( x, y, fcn, clbk, thisArg ) {
152157
sh = x.shape;
153158
sx = x.strides;
154159
sy = y.strides;
155-
if ( x.order === 'row-major' ) {
160+
if ( strides2order( sx ) === 1 ) {
156161
// For row-major ndarrays, the last dimensions have the fastest changing indices...
157162
S0 = sh[ 4 ];
158163
S1 = sh[ 3 ];

0 commit comments

Comments
 (0)