Skip to content

Commit

Permalink
refactor: updated strided2object
Browse files Browse the repository at this point in the history
  • Loading branch information
aman-095 committed Nov 5, 2024
1 parent c975f19 commit 131446e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -677,9 +677,9 @@ tape( 'if provided an `N` parameter less than or equal to `0`, the `main` method
xe = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );
ye = new Float64Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] );

// drotm.main( -1, x, 1, y, 1, param );
// t.deepEqual( x, xe, 'returns expected value' );
// t.deepEqual( y, ye, 'returns expected value' );
drotm.main( -1, x, 1, y, 1, param );
t.deepEqual( x, xe, 'returns expected value' );
t.deepEqual( y, ye, 'returns expected value' );

drotm.main( 0, x, 1, y, 1, param );
t.deepEqual( x, xe, 'returns expected value' );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -752,9 +752,9 @@ tape( 'if provided an `N` parameter less than or equal to `0`, a module instance
xe = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );
ye = new Float64Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] );

// drotm.ndarray( -1, x, 1, 0, y, 1, 0, param );
// t.deepEqual( x, xe, 'returns expected value' );
// t.deepEqual( y, ye, 'returns expected value' );
drotm.ndarray( -1, x, 1, 0, y, 1, 0, param );
t.deepEqual( x, xe, 'returns expected value' );
t.deepEqual( y, ye, 'returns expected value' );

drotm.ndarray( 0, x, 1, 0, y, 1, 0, param );
t.deepEqual( x, xe, 'returns expected value' );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ var arraylike2object = require( '@stdlib/array/base/arraylike2object' );
*/
function strided2object( N, x, stride, offset ) {
var obj = arraylike2object( x );
obj.length = N;
obj.length = ( N > 0 ) ? N : 0;
obj.stride = stride;
obj.offset = offset;
return obj;
Expand Down

0 comments on commit 131446e

Please sign in to comment.