Skip to content

Commit c17403c

Browse files
committed
fix: apply suggestions from code review
--- 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: passed - task: lint_package_json status: na - task: lint_repl_help status: passed - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: passed - task: lint_javascript_tests status: na - 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: passed - task: lint_typescript_tests status: passed - task: lint_license_headers status: passed ---
1 parent fc4a8c5 commit c17403c

7 files changed

Lines changed: 56 additions & 60 deletions

File tree

lib/node_modules/@stdlib/blas/ext/base/ndarray/zunitspace/README.md

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,15 @@ Fills a one-dimensional double-precision complex floating-point ndarray with lin
4343
<!-- eslint-disable max-len -->
4444

4545
```javascript
46-
var Complex128Array = require( '@stdlib/array/complex128' );
46+
var Complex128Vector = require( '@stdlib/ndarray/vector/complex128' );
4747
var Complex128 = require( '@stdlib/complex/float64/ctor' );
48-
var scalar2ndarray = require( '@stdlib/ndarray/base/from-scalar' );
49-
var ndarray = require( '@stdlib/ndarray/base/ctor' );
48+
var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' );
5049

51-
var xbuf = new Complex128Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] );
52-
var x = new ndarray( 'complex128', xbuf, [ 4 ], [ 1 ], 0, 'row-major' );
50+
var x = new Complex128Vector( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] );
5351

54-
var start = scalar2ndarray( new Complex128( 3.0, 0.0 ), 'complex128', 'row-major' );
52+
var start = scalar2ndarray( new Complex128( 3.0, 0.0 ), {
53+
'dtype': 'complex128'
54+
});
5555

5656
var out = zunitspace( [ x, start ] );
5757
// returns <ndarray>[ <Complex128>[ 3.0, 0.0 ], <Complex128>[ 4.0, 0.0 ], <Complex128>[ 5.0, 0.0 ], <Complex128>[ 6.0, 0.0 ] ]
@@ -82,21 +82,19 @@ The function has the following parameters:
8282
<!-- eslint no-undef: "error" -->
8383

8484
```javascript
85-
var zeros = require( '@stdlib/array/zeros' );
86-
var ndarray = require( '@stdlib/ndarray/base/ctor' );
85+
var Complex128Vector = require( '@stdlib/ndarray/vector/complex128' );
8786
var Complex128 = require( '@stdlib/complex/float64/ctor' );
8887
var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' );
8988
var ndarray2array = require( '@stdlib/ndarray/to-array' );
9089
var zunitspace = require( '@stdlib/blas/ext/base/ndarray/zunitspace' );
9190

92-
var xbuf = zeros( 10, 'complex128' );
93-
var x = new ndarray( 'complex128', xbuf, [ xbuf.length ], [ 1 ], 0, 'row-major' );
91+
var x = new Complex128Vector( 10 );
92+
console.log( ndarray2array( x ) );
93+
9494
var start = scalar2ndarray( new Complex128( 3.0, 0.0 ), {
9595
'dtype': 'complex128'
9696
});
9797

98-
console.log( ndarray2array( x ) );
99-
10098
zunitspace( [ x, start ] );
10199
console.log( ndarray2array( x ) );
102100
```

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

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,23 +21,15 @@
2121
// MODULES //
2222

2323
var bench = require( '@stdlib/bench' );
24-
var zeros = require( '@stdlib/array/zeros' );
2524
var pow = require( '@stdlib/math/base/special/pow' );
2625
var format = require( '@stdlib/string/format' );
27-
var ndarray = require( '@stdlib/ndarray/base/ctor' );
28-
var scalar2ndarray = require( '@stdlib/ndarray/base/from-scalar' );
26+
var Complex128Vector = require( '@stdlib/ndarray/vector/complex128' );
2927
var Complex128 = require( '@stdlib/complex/float64/ctor' );
28+
var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' );
3029
var pkg = require( './../package.json' ).name;
3130
var zunitspace = require( './../lib' );
3231

3332

34-
// VARIABLES //
35-
36-
var options = {
37-
'dtype': 'complex128'
38-
};
39-
40-
4133
// FUNCTIONS //
4234

4335
/**
@@ -49,12 +41,12 @@ var options = {
4941
*/
5042
function createBenchmark( len ) {
5143
var start;
52-
var xbuf;
5344
var x;
5445

55-
xbuf = zeros( len, options.dtype );
56-
x = new ndarray( options.dtype, xbuf, [ len ], [ 1 ], 0, 'row-major' );
57-
start = scalar2ndarray( new Complex128( 3.0, 0.0 ), options.dtype, 'row-major' );
46+
start = scalar2ndarray( new Complex128( 3.0, 0.0 ), {
47+
'dtype': 'complex128'
48+
});
49+
x = new Complex128Vector( len );
5850

5951
return benchmark;
6052

lib/node_modules/@stdlib/blas/ext/base/ndarray/zunitspace/docs/repl.txt

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,9 @@
2020

2121
Examples
2222
--------
23-
> var xbuf = new {{alias:@stdlib/array/complex128}}( [ 0.0, 0.0, 0.0, 0.0 ] );
24-
> var dt = 'complex128';
25-
> var sh = [ 2 ];
26-
> var sx = [ 1 ];
27-
> var ox = 0;
28-
> var ord = 'row-major';
29-
> var x = new {{alias:@stdlib/ndarray/ctor}}( dt, xbuf, sh, sx, ox, ord );
23+
> var x = new {{alias:@stdlib/ndarray/vector/complex128}}( [ 0.0, 0.0, 0.0, 0.0 ] );
3024
> var s = new {{alias:@stdlib/complex/float64/ctor}}( 3.0, 0.0 );
31-
> var start = {{alias:@stdlib/ndarray/base/from-scalar}}( s, dt, ord );
25+
> var start = {{alias:@stdlib/ndarray/from-scalar}}( s, { 'dtype': 'complex128' } );
3226
> {{alias}}( [ x, start ] )
3327
<ndarray>[ <Complex128>[ 3.0, 0.0 ], <Complex128>[ 4.0, 0.0 ] ]
3428

lib/node_modules/@stdlib/blas/ext/base/ndarray/zunitspace/docs/types/index.d.ts

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,26 @@ import { complex128ndarray } from '@stdlib/types/ndarray';
2525
/**
2626
* Fills a one-dimensional double-precision complex floating-point ndarray with linearly spaced numeric elements which increment by `1` starting from a specified value.
2727
*
28-
* @param arrays - array-like object containing a one-dimensional input ndarray and a zero-dimensional ndarray containing a starting value
28+
* ## Notes
29+
*
30+
* - The function expects the following ndarrays:
31+
*
32+
* - a one-dimensional input ndarray.
33+
* - a zero-dimensional ndarray containing a starting value.
34+
*
35+
* @param arrays - array-like object containing ndarrays
2936
* @returns input ndarray
3037
*
3138
* @example
32-
* var Complex128Array = require( '@stdlib/array/complex128' );
39+
* var Complex128Vector = require( '@stdlib/ndarray/vector/complex128' );
3340
* var Complex128 = require( '@stdlib/complex/float64/ctor' );
34-
* var scalar2ndarray = require( '@stdlib/ndarray/base/from-scalar' );
35-
* var ndarray = require( '@stdlib/ndarray/base/ctor' );
41+
* var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' );
3642
*
37-
* var xbuf = new Complex128Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] );
38-
* var x = new ndarray( 'complex128', xbuf, [ 4 ], [ 1 ], 0, 'row-major' );
43+
* var x = new Complex128Vector( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] );
3944
*
40-
* var start = scalar2ndarray( new Complex128( 3.0, 0.0 ), 'complex128', 'row-major' );
45+
* var start = scalar2ndarray( new Complex128( 3.0, 0.0 ), {
46+
* 'dtype': 'complex128'
47+
* });
4148
*
4249
* var out = zunitspace( [ x, start ] );
4350
* // returns <ndarray>[ <Complex128>[ 3.0, 0.0 ], <Complex128>[ 4.0, 0.0 ], <Complex128>[ 5.0, 0.0 ], <Complex128>[ 6.0, 0.0 ] ]

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

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,18 @@
1818

1919
'use strict';
2020

21-
var zeros = require( '@stdlib/array/zeros' );
22-
var ndarray = require( '@stdlib/ndarray/base/ctor' );
21+
var Complex128Vector = require( '@stdlib/ndarray/vector/complex128' );
2322
var Complex128 = require( '@stdlib/complex/float64/ctor' );
2423
var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' );
2524
var ndarray2array = require( '@stdlib/ndarray/to-array' );
2625
var zunitspace = require( './../lib' );
2726

28-
var xbuf = zeros( 10, 'complex128' );
29-
var x = new ndarray( 'complex128', xbuf, [ xbuf.length ], [ 1 ], 0, 'row-major' );
27+
var x = new Complex128Vector( 10 );
28+
console.log( ndarray2array( x ) );
29+
3030
var start = scalar2ndarray( new Complex128( 3.0, 0.0 ), {
3131
'dtype': 'complex128'
3232
});
3333

34-
console.log( ndarray2array( x ) );
35-
3634
zunitspace( [ x, start ] );
3735
console.log( ndarray2array( x ) );

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,16 @@
2424
* @module @stdlib/blas/ext/base/ndarray/zunitspace
2525
*
2626
* @example
27-
* var Complex128Array = require( '@stdlib/array/complex128' );
27+
* var Complex128Vector = require( '@stdlib/ndarray/vector/complex128' );
2828
* var Complex128 = require( '@stdlib/complex/float64/ctor' );
29-
* var scalar2ndarray = require( '@stdlib/ndarray/base/from-scalar' );
30-
* var ndarray = require( '@stdlib/ndarray/base/ctor' );
29+
* var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' );
3130
* var zunitspace = require( '@stdlib/blas/ext/base/ndarray/zunitspace' );
3231
*
33-
* var xbuf = new Complex128Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] );
34-
* var x = new ndarray( 'complex128', xbuf, [ 4 ], [ 1 ], 0, 'row-major' );
32+
* var x = new Complex128Vector( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] );
3533
*
36-
* var start = scalar2ndarray( new Complex128( 3.0, 0.0 ), 'complex128', 'row-major' );
34+
* var start = scalar2ndarray( new Complex128( 3.0, 0.0 ), {
35+
* 'dtype': 'complex128'
36+
* });
3737
*
3838
* var out = zunitspace( [ x, start ] );
3939
* // returns <ndarray>[ <Complex128>[ 3.0, 0.0 ], <Complex128>[ 4.0, 0.0 ], <Complex128>[ 5.0, 0.0 ], <Complex128>[ 6.0, 0.0 ] ]

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

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,19 +33,26 @@ var strided = require( '@stdlib/blas/ext/base/zunitspace' ).ndarray;
3333
/**
3434
* Fills a one-dimensional double-precision complex floating-point ndarray with linearly spaced numeric elements which increment by `1` starting from a specified value.
3535
*
36-
* @param {ArrayLikeObject<Object>} arrays - array-like object containing a one-dimensional input ndarray and a zero-dimensional ndarray containing a starting value
36+
* ## Notes
37+
*
38+
* - The function expects the following ndarrays:
39+
*
40+
* - a one-dimensional input ndarray.
41+
* - a zero-dimensional ndarray containing a starting value.
42+
*
43+
* @param {ArrayLikeObject<Object>} arrays - array-like object containing ndarrays
3744
* @returns {ndarray} input ndarray
3845
*
3946
* @example
40-
* var Complex128Array = require( '@stdlib/array/complex128' );
47+
* var Complex128Vector = require( '@stdlib/ndarray/vector/complex128' );
4148
* var Complex128 = require( '@stdlib/complex/float64/ctor' );
42-
* var scalar2ndarray = require( '@stdlib/ndarray/base/from-scalar' );
43-
* var ndarray = require( '@stdlib/ndarray/base/ctor' );
49+
* var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' );
4450
*
45-
* var xbuf = new Complex128Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] );
46-
* var x = new ndarray( 'complex128', xbuf, [ 4 ], [ 1 ], 0, 'row-major' );
51+
* var x = new Complex128Vector( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] );
4752
*
48-
* var start = scalar2ndarray( new Complex128( 3.0, 0.0 ), 'complex128', 'row-major' );
53+
* var start = scalar2ndarray( new Complex128( 3.0, 0.0 ), {
54+
* 'dtype': 'complex128'
55+
* });
4956
*
5057
* var out = zunitspace( [ x, start ] );
5158
* // returns <ndarray>[ <Complex128>[ 3.0, 0.0 ], <Complex128>[ 4.0, 0.0 ], <Complex128>[ 5.0, 0.0 ], <Complex128>[ 6.0, 0.0 ] ]

0 commit comments

Comments
 (0)