Skip to content

Commit 742b7ec

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 a19b8f2 commit 742b7ec

File tree

18 files changed

+108
-18
lines changed

18 files changed

+108
-18
lines changed

lib/node_modules/@stdlib/ndarray/base/nullary/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 nullary10d( x, fcn ) {
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/nullary/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
/**
@@ -132,7 +137,7 @@ function nullary10d( x, fcn ) { // eslint-disable-line max-statements
132137
// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...
133138
sh = x.shape;
134139
sx = x.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[ 9 ];
138143
S1 = sh[ 8 ];

lib/node_modules/@stdlib/ndarray/base/nullary/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 nullary2d( x, fcn ) {
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/nullary/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
/**
@@ -106,7 +111,7 @@ function nullary2d( x, fcn ) {
106111
// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...
107112
sh = x.shape;
108113
sx = x.strides;
109-
if ( x.order === 'row-major' ) {
114+
if ( strides2order( sx ) === 1 ) {
110115
// For row-major ndarrays, the last dimensions have the fastest changing indices...
111116
S0 = sh[ 1 ];
112117
S1 = sh[ 0 ];

lib/node_modules/@stdlib/ndarray/base/nullary/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 nullary3d( x, fcn ) {
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/nullary/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
/**
@@ -109,7 +114,7 @@ function nullary3d( x, fcn ) {
109114
// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...
110115
sh = x.shape;
111116
sx = x.strides;
112-
if ( x.order === 'row-major' ) {
117+
if ( strides2order( sx ) === 1 ) {
113118
// For row-major ndarrays, the last dimensions have the fastest changing indices...
114119
S0 = sh[ 2 ];
115120
S1 = sh[ 1 ];

lib/node_modules/@stdlib/ndarray/base/nullary/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 nullary4d( x, fcn ) {
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/nullary/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
/**
@@ -112,7 +117,7 @@ function nullary4d( x, fcn ) {
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[ 3 ];
118123
S1 = sh[ 2 ];

lib/node_modules/@stdlib/ndarray/base/nullary/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 nullary5d( x, fcn ) {
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/nullary/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
/**
@@ -115,7 +120,7 @@ function nullary5d( x, fcn ) {
115120
// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...
116121
sh = x.shape;
117122
sx = x.strides;
118-
if ( x.order === 'row-major' ) {
123+
if ( strides2order( sx ) === 1 ) {
119124
// For row-major ndarrays, the last dimensions have the fastest changing indices...
120125
S0 = sh[ 4 ];
121126
S1 = sh[ 3 ];

0 commit comments

Comments
 (0)