Skip to content

Commit 92bf1a1

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 742b7ec commit 92bf1a1

File tree

18 files changed

+108
-18
lines changed

18 files changed

+108
-18
lines changed

lib/node_modules/@stdlib/ndarray/base/unary/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
/**
@@ -144,7 +149,7 @@ function unary10d( x, y, fcn ) { // eslint-disable-line max-statements
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[ 9 ];
150155
S1 = sh[ 8 ];

lib/node_modules/@stdlib/ndarray/base/unary/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
/**
@@ -167,7 +172,7 @@ function unary10d( x, y, fcn ) { // eslint-disable-line max-statements
167172
sh = x.shape;
168173
sx = x.strides;
169174
sy = y.strides;
170-
if ( x.order === 'row-major' ) {
175+
if ( strides2order( sx ) === 1 ) {
171176
// For row-major ndarrays, the last dimensions have the fastest changing indices...
172177
S0 = sh[ 9 ];
173178
S1 = sh[ 8 ];

lib/node_modules/@stdlib/ndarray/base/unary/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
/**
@@ -110,7 +115,7 @@ function unary2d( x, y, fcn ) {
110115
sh = x.shape;
111116
sx = x.strides;
112117
sy = y.strides;
113-
if ( x.order === 'row-major' ) {
118+
if ( strides2order( sx ) === 1 ) {
114119
// For row-major ndarrays, the last dimensions have the fastest changing indices...
115120
S0 = sh[ 1 ];
116121
S1 = sh[ 0 ];

lib/node_modules/@stdlib/ndarray/base/unary/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
/**
@@ -133,7 +138,7 @@ function unary2d( x, y, fcn ) {
133138
sh = x.shape;
134139
sx = x.strides;
135140
sy = y.strides;
136-
if ( x.order === 'row-major' ) {
141+
if ( strides2order( sx ) === 1 ) {
137142
// For row-major ndarrays, the last dimensions have the fastest changing indices...
138143
S0 = sh[ 1 ];
139144
S1 = sh[ 0 ];

lib/node_modules/@stdlib/ndarray/base/unary/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
/**
@@ -114,7 +119,7 @@ function unary3d( x, y, fcn ) {
114119
sh = x.shape;
115120
sx = x.strides;
116121
sy = y.strides;
117-
if ( x.order === 'row-major' ) {
122+
if ( strides2order( sx ) === 1 ) {
118123
// For row-major ndarrays, the last dimensions have the fastest changing indices...
119124
S0 = sh[ 2 ];
120125
S1 = sh[ 1 ];

lib/node_modules/@stdlib/ndarray/base/unary/lib/3d_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
/**
@@ -137,7 +142,7 @@ function unary3d( x, y, fcn ) {
137142
sh = x.shape;
138143
sx = x.strides;
139144
sy = y.strides;
140-
if ( x.order === 'row-major' ) {
145+
if ( strides2order( sx ) === 1 ) {
141146
// For row-major ndarrays, the last dimensions have the fastest changing indices...
142147
S0 = sh[ 2 ];
143148
S1 = sh[ 1 ];

lib/node_modules/@stdlib/ndarray/base/unary/lib/4d.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 unary4d( x, y, fcn ) {
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[ 3 ];
124129
S1 = sh[ 2 ];

lib/node_modules/@stdlib/ndarray/base/unary/lib/4d_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
/**
@@ -141,7 +146,7 @@ function unary4d( x, y, fcn ) {
141146
sh = x.shape;
142147
sx = x.strides;
143148
sy = y.strides;
144-
if ( x.order === 'row-major' ) {
149+
if ( strides2order( sx ) === 1 ) {
145150
// For row-major ndarrays, the last dimensions have the fastest changing indices...
146151
S0 = sh[ 3 ];
147152
S1 = sh[ 2 ];

lib/node_modules/@stdlib/ndarray/base/unary/lib/5d.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 unary5d( x, y, fcn ) {
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[ 4 ];
128133
S1 = sh[ 3 ];

lib/node_modules/@stdlib/ndarray/base/unary/lib/5d_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
/**
@@ -145,7 +150,7 @@ function unary5d( x, y, fcn ) {
145150
sh = x.shape;
146151
sx = x.strides;
147152
sy = y.strides;
148-
if ( x.order === 'row-major' ) {
153+
if ( strides2order( sx ) === 1 ) {
149154
// For row-major ndarrays, the last dimensions have the fastest changing indices...
150155
S0 = sh[ 4 ];
151156
S1 = sh[ 3 ];

0 commit comments

Comments
 (0)