Skip to content

Commit

Permalink
feat: add support for accessor strided arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
kgryte committed Nov 23, 2023
1 parent be9d624 commit 6ece459
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/node_modules/@stdlib/array/base/strided2array5d/lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@

'use strict';

// MODULES //

var resolveGetter = require( '@stdlib/array/base/resolve-getter' );


// MAIN //

/**
Expand Down Expand Up @@ -46,6 +51,7 @@
* // returns [ [ [ [ [ 1, 4 ], [ 2, 5 ], [ 3, 6 ] ] ] ] ]
*/
function strided2array5d( x, shape, strides, offset ) {
var get;
var out;
var dx0;
var dx1;
Expand All @@ -71,6 +77,8 @@ function strided2array5d( x, shape, strides, offset ) {
var t2;
var t1;

get = resolveGetter( x );

S4 = shape[ 0 ];
S3 = shape[ 1 ];
S2 = shape[ 2 ];
Expand All @@ -97,7 +105,7 @@ function strided2array5d( x, shape, strides, offset ) {
t1 = [];
ix0 = ix1 + ( dx1*i1 );
for ( i0 = 0; i0 < S0; i0++ ) {
t1.push( x[ ix0 ] );
t1.push( get( x, ix0 ) );
ix0 += dx0;
}
t2.push( t1 );
Expand Down

1 comment on commit 6ece459

@stdlib-bot
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage Report

Package Statements Branches Functions Lines
array/base/accessor-getter $\color{green}208/208$
$\color{green}+100.00\%$
$\color{green}8/8$
$\color{green}+100.00\%$
$\color{green}4/4$
$\color{green}+100.00\%$
$\color{green}208/208$
$\color{green}+100.00\%$
array/base/copy $\color{green}101/101$
$\color{green}+100.00\%$
$\color{green}4/4$
$\color{green}+100.00\%$
$\color{green}1/1$
$\color{green}+100.00\%$
$\color{green}101/101$
$\color{green}+100.00\%$
array/base/from-strided $\color{green}111/111$
$\color{green}+100.00\%$
$\color{green}4/4$
$\color{green}+100.00\%$
$\color{green}1/1$
$\color{green}+100.00\%$
$\color{green}111/111$
$\color{green}+100.00\%$
array/base/getter $\color{green}329/329$
$\color{green}+100.00\%$
$\color{green}16/16$
$\color{green}+100.00\%$
$\color{green}12/12$
$\color{green}+100.00\%$
$\color{green}329/329$
$\color{green}+100.00\%$
array/base/last $\color{green}98/98$
$\color{green}+100.00\%$
$\color{green}4/4$
$\color{green}+100.00\%$
$\color{green}1/1$
$\color{green}+100.00\%$
$\color{green}98/98$
$\color{green}+100.00\%$
array/base $\color{green}942/942$
$\color{green}+100.00\%$
$\color{green}1/1$
$\color{green}+100.00\%$
$\color{green}0/0$
$\color{green}+100.00\%$
$\color{green}942/942$
$\color{green}+100.00\%$
array/base/resolve-getter $\color{green}98/98$
$\color{green}+100.00\%$
$\color{green}5/5$
$\color{green}+100.00\%$
$\color{green}1/1$
$\color{green}+100.00\%$
$\color{green}98/98$
$\color{green}+100.00\%$
array/base/strided2array2d $\color{green}134/134$
$\color{green}+100.00\%$
$\color{green}5/5$
$\color{green}+100.00\%$
$\color{green}1/1$
$\color{green}+100.00\%$
$\color{green}134/134$
$\color{green}+100.00\%$
array/base/strided2array3d $\color{green}146/146$
$\color{green}+100.00\%$
$\color{green}6/6$
$\color{green}+100.00\%$
$\color{green}1/1$
$\color{green}+100.00\%$
$\color{green}146/146$
$\color{green}+100.00\%$
array/base/strided2array4d $\color{green}158/158$
$\color{green}+100.00\%$
$\color{green}7/7$
$\color{green}+100.00\%$
$\color{green}1/1$
$\color{green}+100.00\%$
$\color{green}158/158$
$\color{green}+100.00\%$
array/base/strided2array5d $\color{green}170/170$
$\color{green}+100.00\%$
$\color{green}7/7$
$\color{green}+100.00\%$
$\color{green}1/1$
$\color{green}+100.00\%$
$\color{green}170/170$
$\color{green}+100.00\%$

The above coverage report was generated for the changes in this push.

Please sign in to comment.