Skip to content

Commit 6ece459

Browse files
committed
feat: add support for accessor strided arrays
1 parent be9d624 commit 6ece459

File tree

1 file changed

+9
-1
lines changed
  • lib/node_modules/@stdlib/array/base/strided2array5d/lib

1 file changed

+9
-1
lines changed

lib/node_modules/@stdlib/array/base/strided2array5d/lib/main.js

+9-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@
1818

1919
'use strict';
2020

21+
// MODULES //
22+
23+
var resolveGetter = require( '@stdlib/array/base/resolve-getter' );
24+
25+
2126
// MAIN //
2227

2328
/**
@@ -46,6 +51,7 @@
4651
* // returns [ [ [ [ [ 1, 4 ], [ 2, 5 ], [ 3, 6 ] ] ] ] ]
4752
*/
4853
function strided2array5d( x, shape, strides, offset ) {
54+
var get;
4955
var out;
5056
var dx0;
5157
var dx1;
@@ -71,6 +77,8 @@ function strided2array5d( x, shape, strides, offset ) {
7177
var t2;
7278
var t1;
7379

80+
get = resolveGetter( x );
81+
7482
S4 = shape[ 0 ];
7583
S3 = shape[ 1 ];
7684
S2 = shape[ 2 ];
@@ -97,7 +105,7 @@ function strided2array5d( x, shape, strides, offset ) {
97105
t1 = [];
98106
ix0 = ix1 + ( dx1*i1 );
99107
for ( i0 = 0; i0 < S0; i0++ ) {
100-
t1.push( x[ ix0 ] );
108+
t1.push( get( x, ix0 ) );
101109
ix0 += dx0;
102110
}
103111
t2.push( t1 );

0 commit comments

Comments
 (0)