Skip to content

Commit 1e0917b

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 92bf1a1 commit 1e0917b

File tree

18 files changed

+108
-18
lines changed

18 files changed

+108
-18
lines changed

lib/node_modules/@stdlib/ndarray/base/unary-accumulate/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
/**
@@ -112,7 +117,7 @@ function accumulate10d( x, initial, clbk ) { // eslint-disable-line max-statemen
112117
// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...
113118
sh = x.shape;
114119
sx = x.strides;
115-
if ( x.order === 'row-major' ) {
120+
if ( strides2order( sx ) === 1 ) {
116121
// For row-major ndarrays, the last dimensions have the fastest changing indices...
117122
S0 = sh[ 9 ];
118123
S1 = sh[ 8 ];

lib/node_modules/@stdlib/ndarray/base/unary-accumulate/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
/**
@@ -133,7 +138,7 @@ function accumulate10d( x, initial, clbk ) { // eslint-disable-line max-statemen
133138
// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...
134139
sh = x.shape;
135140
sx = x.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[ 9 ];
139144
S1 = sh[ 8 ];

lib/node_modules/@stdlib/ndarray/base/unary-accumulate/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
/**
@@ -86,7 +91,7 @@ function accumulate2d( x, initial, clbk ) {
8691
// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...
8792
sh = x.shape;
8893
sx = x.strides;
89-
if ( x.order === 'row-major' ) {
94+
if ( strides2order( sx ) === 1 ) {
9095
// For row-major ndarrays, the last dimensions have the fastest changing indices...
9196
S0 = sh[ 1 ];
9297
S1 = sh[ 0 ];

lib/node_modules/@stdlib/ndarray/base/unary-accumulate/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
/**
@@ -107,7 +112,7 @@ function accumulate2d( x, initial, clbk ) {
107112
// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...
108113
sh = x.shape;
109114
sx = x.strides;
110-
if ( x.order === 'row-major' ) {
115+
if ( strides2order( sx ) === 1 ) {
111116
// For row-major ndarrays, the last dimensions have the fastest changing indices...
112117
S0 = sh[ 1 ];
113118
S1 = sh[ 0 ];

lib/node_modules/@stdlib/ndarray/base/unary-accumulate/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
/**
@@ -89,7 +94,7 @@ function accumulate3d( x, initial, clbk ) {
8994
// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...
9095
sh = x.shape;
9196
sx = x.strides;
92-
if ( x.order === 'row-major' ) {
97+
if ( strides2order( sx ) === 1 ) {
9398
// For row-major ndarrays, the last dimensions have the fastest changing indices...
9499
S0 = sh[ 2 ];
95100
S1 = sh[ 1 ];

lib/node_modules/@stdlib/ndarray/base/unary-accumulate/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
/**
@@ -110,7 +115,7 @@ function accumulate3d( x, initial, clbk ) {
110115
// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...
111116
sh = x.shape;
112117
sx = x.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[ 2 ];
116121
S1 = sh[ 1 ];

lib/node_modules/@stdlib/ndarray/base/unary-accumulate/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
/**
@@ -92,7 +97,7 @@ function accumulate4d( x, initial, clbk ) {
9297
// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...
9398
sh = x.shape;
9499
sx = x.strides;
95-
if ( x.order === 'row-major' ) {
100+
if ( strides2order( sx ) === 1 ) {
96101
// For row-major ndarrays, the last dimensions have the fastest changing indices...
97102
S0 = sh[ 3 ];
98103
S1 = sh[ 2 ];

lib/node_modules/@stdlib/ndarray/base/unary-accumulate/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
/**
@@ -113,7 +118,7 @@ function accumulate4d( x, initial, clbk ) {
113118
// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...
114119
sh = x.shape;
115120
sx = x.strides;
116-
if ( x.order === 'row-major' ) {
121+
if ( strides2order( sx ) === 1 ) {
117122
// For row-major ndarrays, the last dimensions have the fastest changing indices...
118123
S0 = sh[ 3 ];
119124
S1 = sh[ 2 ];

lib/node_modules/@stdlib/ndarray/base/unary-accumulate/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
/**
@@ -95,7 +100,7 @@ function accumulate5d( x, initial, clbk ) {
95100
// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...
96101
sh = x.shape;
97102
sx = x.strides;
98-
if ( x.order === 'row-major' ) {
103+
if ( strides2order( sx ) === 1 ) {
99104
// For row-major ndarrays, the last dimensions have the fastest changing indices...
100105
S0 = sh[ 4 ];
101106
S1 = sh[ 3 ];

lib/node_modules/@stdlib/ndarray/base/unary-accumulate/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
/**
@@ -116,7 +121,7 @@ function accumulate5d( x, initial, clbk ) {
116121
// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...
117122
sh = x.shape;
118123
sx = x.strides;
119-
if ( x.order === 'row-major' ) {
124+
if ( strides2order( sx ) === 1 ) {
120125
// For row-major ndarrays, the last dimensions have the fastest changing indices...
121126
S0 = sh[ 4 ];
122127
S1 = sh[ 3 ];

0 commit comments

Comments
 (0)