Skip to content

Commit 302c58c

Browse files
committed
refactor: apply code review suggestions
--- 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: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: passed - 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 --- --- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: na - task: run_c_examples status: na - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: na - task: run_c_benchmarks status: na - task: run_cpp_benchmarks status: na - task: run_fortran_benchmarks status: na - task: run_javascript_benchmarks status: passed - task: run_julia_benchmarks status: na - task: run_python_benchmarks status: na - task: run_r_benchmarks status: na - task: run_javascript_tests status: passed ---
1 parent be1d2b1 commit 302c58c

File tree

4 files changed

+12
-26
lines changed

4 files changed

+12
-26
lines changed

lib/node_modules/@stdlib/blas/ext/base/gnannsumkbn/benchmark/benchmark.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ var discreteUniform = require( '@stdlib/random/base/discrete-uniform' );
2626
var filledarrayBy = require( '@stdlib/array/filled-by' );
2727
var isnan = require( '@stdlib/math/base/assert/is-nan' );
2828
var pow = require( '@stdlib/math/base/special/pow' );
29-
var Float64Array = require( '@stdlib/array/float64' );
29+
var zeros = require( '@stdlib/array/base/zeros' );
3030
var pkg = require( './../package.json' ).name;
3131
var gnannsumkbn = require( './../lib/main.js' );
3232

@@ -54,8 +54,8 @@ function rand() {
5454
* @returns {Function} benchmark function
5555
*/
5656
function createBenchmark( len ) {
57-
var out = new Float64Array( 2 );
58-
var x = filledarrayBy( len, 'float64', rand );
57+
var out = zeros( 2 );
58+
var x = filledarrayBy( len, 'generic', rand );
5959
return benchmark;
6060

6161
function benchmark( b ) {

lib/node_modules/@stdlib/blas/ext/base/gnannsumkbn/benchmark/benchmark.ndarray.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ var discreteUniform = require( '@stdlib/random/base/discrete-uniform' );
2626
var filledarrayBy = require( '@stdlib/array/filled-by' );
2727
var isnan = require( '@stdlib/math/base/assert/is-nan' );
2828
var pow = require( '@stdlib/math/base/special/pow' );
29-
var Float64Array = require( '@stdlib/array/float64' );
29+
var zeros = require( '@stdlib/array/base/zeros' );
3030
var pkg = require( './../package.json' ).name;
3131
var gnannsumkbn = require( './../lib/ndarray.js' );
3232

@@ -54,8 +54,8 @@ function rand() {
5454
* @returns {Function} benchmark function
5555
*/
5656
function createBenchmark( len ) {
57-
var out = new Float64Array( 2 );
58-
var x = filledarrayBy( len, 'float64', rand );
57+
var out = zeros( 2 );
58+
var x = filledarrayBy( len, 'generic', rand );
5959
return benchmark;
6060

6161
function benchmark( b ) {

lib/node_modules/@stdlib/blas/ext/base/gnannsumkbn/test/test.main.js

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
// MODULES //
2222

2323
var tape = require( 'tape' );
24-
var floor = require( '@stdlib/math/base/special/floor' );
2524
var Float64Array = require( '@stdlib/array/float64' );
2625
var gnannsumkbn = require( './../lib' );
2726

@@ -163,7 +162,6 @@ tape( 'if provided an `N` parameter equal to `1`, the function returns a sum equ
163162
tape( 'the function supports `stride` parameters', function test( t ) {
164163
var expected;
165164
var out;
166-
var N;
167165
var x;
168166
var v;
169167

@@ -181,8 +179,7 @@ tape( 'the function supports `stride` parameters', function test( t ) {
181179
];
182180
out = [ 0.0, 0.0, 0.0, 0.0 ];
183181

184-
N = floor( x.length / 2 );
185-
v = gnannsumkbn( N, x, 2, out, 2 );
182+
v = gnannsumkbn( 5, x, 2, out, 2 );
186183

187184
expected = [ 5.0, 0.0, 4.0, 0.0 ];
188185
t.deepEqual( v, expected, 'returns expected value' );
@@ -193,7 +190,6 @@ tape( 'the function supports `stride` parameters', function test( t ) {
193190
tape( 'the function supports negative `stride` parameters', function test( t ) {
194191
var expected;
195192
var out;
196-
var N;
197193
var x;
198194
var v;
199195

@@ -211,8 +207,7 @@ tape( 'the function supports negative `stride` parameters', function test( t ) {
211207
];
212208
out = [ 0.0, 0.0, 0.0, 0.0 ];
213209

214-
N = floor( x.length / 2 );
215-
v = gnannsumkbn( N, x, -2, out, -2 );
210+
v = gnannsumkbn( 5, x, -2, out, -2 );
216211

217212
expected = [ 4.0, 0.0, 5.0, 0.0 ];
218213
t.deepEqual( v, expected, 'returns expected value' );
@@ -261,7 +256,6 @@ tape( 'the function supports view offsets', function test( t ) {
261256
var out1;
262257
var x0;
263258
var x1;
264-
var N;
265259
var v;
266260

267261
x0 = new Float64Array([
@@ -281,9 +275,8 @@ tape( 'the function supports view offsets', function test( t ) {
281275

282276
x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element
283277
out1 = new Float64Array( out0.buffer, out0.BYTES_PER_ELEMENT*2 ); // start at the 3rd element
284-
N = floor(x1.length / 2);
285278

286-
v = gnannsumkbn( N, x1, 2, out1, 1 );
279+
v = gnannsumkbn( 5, x1, 2, out1, 1 );
287280

288281
expected0 = new Float64Array( [ 0.0, 0.0, 5.0, 4.0 ] );
289282
expected1 = new Float64Array( [ 5.0, 4.0 ] );

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

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
// MODULES //
2222

2323
var tape = require( 'tape' );
24-
var floor = require( '@stdlib/math/base/special/floor' );
2524
var gnannsumkbn = require( './../lib/ndarray.js' );
2625

2726

@@ -162,7 +161,6 @@ tape( 'if provided an `N` parameter equal to `1`, the function returns the first
162161
tape( 'the function supports a `stride` parameter', function test( t ) {
163162
var expected;
164163
var out;
165-
var N;
166164
var x;
167165
var v;
168166

@@ -180,8 +178,7 @@ tape( 'the function supports a `stride` parameter', function test( t ) {
180178
];
181179
out = [ 0.0, 0.0, 0.0, 0.0 ];
182180

183-
N = floor( x.length / 2 );
184-
v = gnannsumkbn( N, x, 2, 0, out, 2, 0 );
181+
v = gnannsumkbn( 5, x, 2, 0, out, 2, 0 );
185182

186183
expected = [ 5.0, 0.0, 4.0, 0.0 ];
187184
t.deepEqual( v, expected, 'returns expected value' );
@@ -192,7 +189,6 @@ tape( 'the function supports a `stride` parameter', function test( t ) {
192189
tape( 'the function supports a negative `stride` parameter', function test( t ) {
193190
var expected;
194191
var out;
195-
var N;
196192
var x;
197193
var v;
198194

@@ -210,8 +206,7 @@ tape( 'the function supports a negative `stride` parameter', function test( t )
210206
];
211207
out = [ 0.0, 0.0, 0.0, 0.0 ];
212208

213-
N = floor( x.length / 2 );
214-
v = gnannsumkbn( N, x, -2, 8, out, -2, 2 );
209+
v = gnannsumkbn( 5, x, -2, 8, out, -2, 2 );
215210

216211
expected = [ 4.0, 0.0, 5.0, 0.0 ];
217212
t.deepEqual( v, expected, 'returns expected value' );
@@ -256,7 +251,6 @@ tape( 'if provided a `stride` parameter equal to `0` and the first element is `N
256251
tape( 'the function supports `offset` parameters', function test( t ) {
257252
var expected;
258253
var out;
259-
var N;
260254
var x;
261255
var v;
262256

@@ -273,9 +267,8 @@ tape( 'the function supports `offset` parameters', function test( t ) {
273267
NaN // 4
274268
];
275269
out = [ 0.0, 0.0, 0.0, 0.0 ];
276-
N = floor( x.length / 2 );
277270

278-
v = gnannsumkbn( N, x, 2, 1, out, 2, 1 );
271+
v = gnannsumkbn( 5, x, 2, 1, out, 2, 1 );
279272

280273
expected = [ 0.0, 5.0, 0.0, 4.0 ];
281274
t.deepEqual( v, expected, 'returns expected value' );

0 commit comments

Comments
 (0)