Skip to content

Commit dc083b0

Browse files
committed
fixed some minor things
1 parent 2968353 commit dc083b0

File tree

3 files changed

+9
-17
lines changed

3 files changed

+9
-17
lines changed

lib/node_modules/@stdlib/blas/ext/base/ndarray/sfill/examples/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
'use strict';
2020

2121
var discreteUniform = require( '@stdlib/random/array/discrete-uniform' );
22-
var Float32Array = require( '@stdlib/array/float32' );
2322
var array = require( '@stdlib/ndarray/array' );
2423
var sfill = require( './../lib' );
2524

lib/node_modules/@stdlib/blas/ext/base/ndarray/sfill/lib/main.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,11 @@ var strided = require( '@stdlib/blas/ext/base/sfill' ).ndarray;
4848
* // returns <Float32Array>[ 5.0, 5.0, 5.0 ]
4949
*/
5050
function sfill( x, alpha ) {
51-
strided( numelDimension( x, 0 ), alpha, getData( x ), getStride( x, 0 ), getOffset( x ) );
51+
var N = numelDimension( x, 0 );
52+
var stride = getStride( x, 0 );
53+
var offset = getOffset( x );
54+
55+
strided( N, alpha, getData( x ), stride, offset );
5256
return x;
5357
}
5458

lib/node_modules/@stdlib/blas/ext/base/ndarray/sfill/test/test.js

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
var tape = require( 'tape' );
2424
var Float32Array = require( '@stdlib/array/float32' );
25+
var ndarray = require( '@stdlib/ndarray/base/ctor' );
2526
var array = require( '@stdlib/ndarray/array' );
2627
var sfill = require( './../lib' );
2728

@@ -75,11 +76,7 @@ tape( 'the function supports an ndarray having a stride greater than 1', functio
7576
4.0,
7677
5.0 // 2
7778
]);
78-
x = array( xbuf, {
79-
'shape': [ 3 ],
80-
'strides': [ 2 ],
81-
'offset': 0
82-
});
79+
x = new ndarray( 'float32', xbuf, [ 3 ], [ 2 ], 0, 'row-major' );
8380
expected = new Float32Array( [ 5.0, 2.0, 5.0, 4.0, 5.0 ] );
8481

8582
sfill( x, 5.0 );
@@ -100,11 +97,7 @@ tape( 'the function supports an ndarray having a negative stride', function test
10097
4.0,
10198
5.0 // 0
10299
]);
103-
x = array( xbuf, {
104-
'shape': [ 3 ],
105-
'strides': [ -2 ],
106-
'offset': 4
107-
});
100+
x = new ndarray( 'float32', xbuf, [ 3 ], [ -2 ], 4, 'row-major' );
108101
expected = new Float32Array( [ 5.0, 2.0, 5.0, 4.0, 5.0 ] );
109102

110103
sfill( x, 5.0 );
@@ -125,11 +118,7 @@ tape( 'the function supports an ndarray having an offset', function test( t ) {
125118
4.0, // 2
126119
5.0
127120
]);
128-
x = array( xbuf, {
129-
'shape': [ 3 ],
130-
'strides': [ 1 ],
131-
'offset': 1
132-
});
121+
x = new ndarray( 'float32', xbuf, [ 3 ], [ 1 ], 1, 'row-major' );
133122
expected = new Float32Array( [ 1.0, 5.0, 5.0, 5.0, 5.0 ] );
134123

135124
sfill( x, 5.0 );

0 commit comments

Comments
 (0)