Skip to content

Commit 141807f

Browse files
authored
Merge branch 'develop' into nd/base-toRot901
2 parents 33d0690 + 9188369 commit 141807f

164 files changed

Lines changed: 2041 additions & 994 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ package.json.copy
2525
###############
2626
build/
2727
downloads/
28+
plans/
2829
reports/
2930
tmp/
3031

@@ -175,6 +176,10 @@ acs-*.bib
175176
*.ind
176177
*.ist
177178

179+
# Git #
180+
#######
181+
.worktrees
182+
178183
# Visual Studio #
179184
#################
180185
.vscode/

docs/migration-guides/numpy/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ limitations under the License.
3535
| Broadcast a scalar to a specified shape | `np.broadcast_to(np.array(scalar), shape)` | [`broadcastScalar(scalar, shape)`][@stdlib/ndarray/broadcast-scalar] |
3636
| Copy an array | `np.copy(x)` | [`copy(x)`][@stdlib/ndarray/copy] |
3737
| Count the number of falsy values in an array | `x.size-np.count_nonzero(x)` | [`countFalsy(x)`][@stdlib/ndarray/count-falsy] |
38-
| Count the number of truthy values in an array | `np.count_nonzeros(x)` | [`countTruthy(x)`][@stdlib/ndarray/count-truthy] |
38+
| Count the number of truthy values in an array | `np.count_nonzero(x)` | [`countTruthy(x)`][@stdlib/ndarray/count-truthy] |
3939
| Test whether an array includes a specific value | `np.any(np.equal(x,v))` | [`includes(x,v)`][@stdlib/ndarray/includes] |
4040
| Reverse the elements along a dimension | `np.flip(x, axis=dim)` | [`reverseDimension(x, dim)`][@stdlib/ndarray/reverse-dimension] |
41-
| Prepend a a specified number of singleton dimensions | `np.reshape(x, (1,)*n + x.shape)` | [`prependSingletonDimensions(x, n)`][@stdlib/ndarray/prepend-singleton-dimensions] |
41+
| Prepend a specified number of singleton dimensions | `np.reshape(x, (1,)*n + x.shape)` | [`prependSingletonDimensions(x, n)`][@stdlib/ndarray/prepend-singleton-dimensions] |
4242
| Test whether an array contains at least `n` truthy values | `np.count_nonzero(x) >= n` | [`some(x, n)`][@stdlib/ndarray/some] |
4343

4444
<!-- lint enable table-pipe-alignment -->

lib/node_modules/@stdlib/blas/base/ndarray/caxpy/README.md

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -41,18 +41,16 @@ var caxpy = require( '@stdlib/blas/base/ndarray/caxpy' );
4141
Multiplies a one-dimensional single-precision complex floating-point ndarray `x` by a constant `alpha` and adds the result to a one-dimensional single-precision complex floating-point ndarray `y`.
4242

4343
```javascript
44-
var Complex64Array = require( '@stdlib/array/complex64' );
44+
var Complex64Vector = require( '@stdlib/ndarray/vector/complex64' );
4545
var Complex64 = require( '@stdlib/complex/float32/ctor' );
46-
var scalar2ndarray = require( '@stdlib/ndarray/base/from-scalar' );
47-
var ndarray = require( '@stdlib/ndarray/base/ctor' );
48-
49-
var xbuf = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
50-
var x = new ndarray( 'complex64', xbuf, [ 3 ], [ 1 ], 0, 'row-major' );
46+
var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' );
5147

52-
var ybuf = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] );
53-
var y = new ndarray( 'complex64', ybuf, [ 3 ], [ 1 ], 0, 'row-major' );
48+
var x = new Complex64Vector( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
49+
var y = new Complex64Vector( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] );
5450

55-
var alpha = scalar2ndarray( new Complex64( 1.0, 2.0 ), 'complex64', 'row-major' );
51+
var alpha = scalar2ndarray( new Complex64( 1.0, 2.0 ), {
52+
'dtype': 'complex64'
53+
});
5654
var z = caxpy( [ x, y, alpha ] );
5755
// returns <ndarray>[ <Complex64>[ -2.0, 5.0 ], <Complex64>[ -4.0, 11.0 ], <Complex64>[ -6.0, 17.0 ] ]
5856

@@ -62,7 +60,11 @@ var bool = ( y === z );
6260

6361
The function has the following parameters:
6462

65-
- **arrays**: array-like object containing an input ndarray, an output ndarray, and a zero-dimensional ndarray containing a scalar constant.
63+
- **arrays**: array-like object containing the following ndarrays in order:
64+
65+
- input ndarray
66+
- output ndarray
67+
- zero-dimensional ndarray containing a scalar constant
6668

6769
</section>
6870

@@ -82,23 +84,20 @@ The function has the following parameters:
8284

8385
```javascript
8486
var discreteUniform = require( '@stdlib/random/array/discrete-uniform' );
85-
var Complex64Array = require( '@stdlib/array/complex64' );
87+
var Complex64Vector = require( '@stdlib/ndarray/vector/complex64' );
8688
var Complex64 = require( '@stdlib/complex/float32/ctor' );
8789
var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' );
88-
var ndarray = require( '@stdlib/ndarray/base/ctor' );
8990
var ndarray2array = require( '@stdlib/ndarray/to-array' );
9091
var caxpy = require( '@stdlib/blas/base/ndarray/caxpy' );
9192

9293
var opts = {
9394
'dtype': 'float32'
9495
};
9596

96-
var xbuf = new Complex64Array( discreteUniform( 10, 0, 100, opts ) );
97-
var x = new ndarray( 'complex64', xbuf, [ xbuf.length ], [ 1 ], 0, 'row-major' );
97+
var x = new Complex64Vector( discreteUniform( 10, 0, 100, opts ) );
9898
console.log( ndarray2array( x ) );
9999

100-
var ybuf = new Complex64Array( discreteUniform( xbuf.length*2, 0, 10, opts ) );
101-
var y = new ndarray( 'complex64', ybuf, [ ybuf.length ], [ 1 ], 0, 'row-major' );
100+
var y = new Complex64Vector( discreteUniform( 10, 0, 10, opts ) );
102101
console.log( ndarray2array( y ) );
103102

104103
var alpha = scalar2ndarray( new Complex64( 1.0, 2.0 ), {

lib/node_modules/@stdlib/blas/base/ndarray/caxpy/benchmark/benchmark.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,8 @@ var uniform = require( '@stdlib/random/array/uniform' );
2525
var isnanf = require( '@stdlib/math/base/assert/is-nanf' );
2626
var realf = require( '@stdlib/complex/float32/real' );
2727
var pow = require( '@stdlib/math/base/special/pow' );
28-
var ndarray = require( '@stdlib/ndarray/base/ctor' );
29-
var scalar2ndarray = require( '@stdlib/ndarray/base/from-scalar' );
30-
var Complex64Array = require( '@stdlib/array/complex64' );
28+
var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' );
29+
var Complex64Vector = require( '@stdlib/ndarray/vector/complex64' );
3130
var Complex64 = require( '@stdlib/complex/float32/ctor' );
3231
var format = require( '@stdlib/string/format' );
3332
var pkg = require( './../package.json' ).name;
@@ -60,14 +59,14 @@ function createBenchmark( len ) {
6059
xbuf = uniform( len*2, -100.0, 100.0, {
6160
'dtype': 'float32'
6261
});
63-
x = new ndarray( options.dtype, new Complex64Array( xbuf ), [ len ], [ 1 ], 0, 'row-major' );
62+
x = new Complex64Vector( xbuf.buffer );
6463

6564
ybuf = uniform( len*2, -100.0, 100.0, {
6665
'dtype': 'float32'
6766
});
68-
y = new ndarray( options.dtype, new Complex64Array( ybuf ), [ len ], [ 1 ], 0, 'row-major' );
67+
y = new Complex64Vector( ybuf.buffer );
6968

70-
alpha = scalar2ndarray( new Complex64( 1.0, 2.0 ), options.dtype, 'row-major' );
69+
alpha = scalar2ndarray( new Complex64( 1.0, 2.0 ), options );
7170

7271
return benchmark;
7372

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

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,10 @@
2020

2121
Examples
2222
--------
23-
> var xbuf = new {{alias:@stdlib/array/complex64}}( [ 4.0, 2.0, -3.0, 5.0 ] );
24-
> var ybuf = new {{alias:@stdlib/array/complex64}}( [ 2.0, 6.0, -1.0, -4.0 ] );
25-
> var dt = 'complex64';
26-
> var sh = [ xbuf.length ];
27-
> var st = [ 1 ];
28-
> var oo = 0;
29-
> var ord = 'row-major';
30-
> var x = new {{alias:@stdlib/ndarray/ctor}}( dt, xbuf, sh, st, oo, ord );
31-
> var y = new {{alias:@stdlib/ndarray/ctor}}( dt, ybuf, sh, st, oo, ord );
23+
> var x = new {{alias:@stdlib/ndarray/vector/complex64}}( [ 4.0, 2.0, -3.0, 5.0 ] );
24+
> var y = new {{alias:@stdlib/ndarray/vector/complex64}}( [ 2.0, 6.0, -1.0, -4.0 ] );
3225
> var ca = new {{alias:@stdlib/complex/float32/ctor}}( 1.0, 2.0 );
33-
> var alpha = {{alias:@stdlib/ndarray/base/from-scalar}}( ca, dt, ord );
26+
> var alpha = {{alias:@stdlib/ndarray/from-scalar}}( ca, { 'dtype': 'complex64' } );
3427

3528
> {{alias}}( [ x, y, alpha ] );
3629
> y

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

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,16 @@ import { complex64ndarray } from '@stdlib/types/ndarray';
2929
* @returns output ndarray
3030
*
3131
* @example
32-
* var Complex64Array = require( '@stdlib/array/complex64' );
32+
* var Complex64Vector = require( '@stdlib/ndarray/vector/complex64' );
3333
* var Complex64 = require( '@stdlib/complex/float32/ctor' );
34-
* var scalar2ndarray = require( '@stdlib/ndarray/base/from-scalar' );
35-
* var ndarray = require( '@stdlib/ndarray/base/ctor' );
34+
* var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' );
3635
*
37-
* var xbuf = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0 ] );
38-
* var x = new ndarray( 'complex64', xbuf, [ 5 ], [ 1 ], 0, 'row-major' );
36+
* var x = new Complex64Vector( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0 ] );
37+
* var y = new Complex64Vector( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] );
3938
*
40-
* var ybuf = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] );
41-
* var y = new ndarray( 'complex64', ybuf, [ 5 ], [ 1 ], 0, 'row-major' );
42-
*
43-
* var alpha = scalar2ndarray( new Complex64( 1.0, 2.0 ), 'complex64', 'row-major' );
39+
* var alpha = scalar2ndarray( new Complex64( 1.0, 2.0 ), {
40+
* 'dtype': 'complex64'
41+
* });
4442
*
4543
* var z = caxpy( [ x, y, alpha ] );
4644
* // returns <ndarray>[ <Complex64>[ -2.0, 5.0 ], <Complex64>[ -4.0, 11.0 ], <Complex64>[ -6.0, 17.0 ], <Complex64>[ -8.0, 23.0 ], <Complex64>[ -10.0, 29.0 ] ]

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

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,20 @@
1919
'use strict';
2020

2121
var discreteUniform = require( '@stdlib/random/array/discrete-uniform' );
22-
var Complex64Array = require( '@stdlib/array/complex64' );
22+
var Complex64Vector = require( '@stdlib/ndarray/vector/complex64' );
2323
var Complex64 = require( '@stdlib/complex/float32/ctor' );
2424
var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' );
25-
var ndarray = require( '@stdlib/ndarray/base/ctor' );
2625
var ndarray2array = require( '@stdlib/ndarray/to-array' );
2726
var caxpy = require( './../lib' );
2827

2928
var opts = {
3029
'dtype': 'float32'
3130
};
3231

33-
var xbuf = new Complex64Array( discreteUniform( 10, 0, 100, opts ) );
34-
var x = new ndarray( 'complex64', xbuf, [ xbuf.length ], [ 1 ], 0, 'row-major' );
32+
var x = new Complex64Vector( discreteUniform( 10, 0, 100, opts ) );
3533
console.log( ndarray2array( x ) );
3634

37-
var ybuf = new Complex64Array( discreteUniform( xbuf.length*2, 0, 10, opts ) );
38-
var y = new ndarray( 'complex64', ybuf, [ ybuf.length ], [ 1 ], 0, 'row-major' );
35+
var y = new Complex64Vector( discreteUniform( 10, 0, 10, opts ) );
3936
console.log( ndarray2array( y ) );
4037

4138
var alpha = scalar2ndarray( new Complex64( 1.0, 2.0 ), {

lib/node_modules/@stdlib/blas/base/ndarray/caxpy/lib/index.js

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,20 @@
2424
* @module @stdlib/blas/base/ndarray/caxpy
2525
*
2626
* @example
27-
* var Complex64Array = require( '@stdlib/array/complex64' );
27+
* var Complex64Vector = require( '@stdlib/ndarray/vector/complex64' );
2828
* var Complex64 = require( '@stdlib/complex/float32/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 caxpy = require( '@stdlib/blas/base/ndarray/caxpy' );
3231
*
33-
* var xbuf = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );
34-
* var x = new ndarray( 'complex64', xbuf, [ 4 ], [ 1 ], 0, 'row-major' );
32+
* var x = new Complex64Vector( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0 ] );
33+
* var y = new Complex64Vector( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] );
3534
*
36-
* var ybuf = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] );
37-
* var y = new ndarray( 'complex64', ybuf, [ 4 ], [ 1 ], 0, 'row-major' );
38-
*
39-
* var alpha = scalar2ndarray( new Complex64( 1.0, 2.0 ), 'complex64', 'row-major' );
35+
* var alpha = scalar2ndarray( new Complex64( 1.0, 2.0 ), {
36+
* 'dtype': 'complex64'
37+
* });
4038
*
4139
* var z = caxpy( [ x, y, alpha ] );
42-
* // returns <ndarray>[ <Complex64>[ -2.0, 5.0 ], <Complex64>[ -4.0, 11.0 ], <Complex64>[ -6.0, 17.0 ], <Complex64>[ -8.0, 23.0 ] ]
40+
* // returns <ndarray>[ <Complex64>[ -2.0, 5.0 ], <Complex64>[ -4.0, 11.0 ], <Complex64>[ -6.0, 17.0 ], <Complex64>[ -8.0, 23.0 ], <Complex64>[ -10.0, 29.0 ] ]
4341
*
4442
* var bool = ( z === y );
4543
* // returns true

lib/node_modules/@stdlib/blas/base/ndarray/caxpy/lib/main.js

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,21 +37,19 @@ var strided = require( '@stdlib/blas/base/caxpy' ).ndarray;
3737
* @returns {Object} output ndarray
3838
*
3939
* @example
40-
* var Complex64Array = require( '@stdlib/array/complex64' );
40+
* var Complex64Vector = require( '@stdlib/ndarray/vector/complex64' );
4141
* var Complex64 = require( '@stdlib/complex/float32/ctor' );
42-
* var scalar2ndarray = require( '@stdlib/ndarray/base/from-scalar' );
43-
* var ndarray = require( '@stdlib/ndarray/base/ctor' );
42+
* var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' );
4443
*
45-
* var xbuf = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );
46-
* var x = new ndarray( 'complex64', xbuf, [ 4 ], [ 1 ], 0, 'row-major' );
44+
* var x = new Complex64Vector( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0 ] );
45+
* var y = new Complex64Vector( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] );
4746
*
48-
* var ybuf = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] );
49-
* var y = new ndarray( 'complex64', ybuf, [ 4 ], [ 1 ], 0, 'row-major' );
50-
*
51-
* var alpha = scalar2ndarray( new Complex64( 1.0, 2.0 ), 'complex64', 'row-major' );
47+
* var alpha = scalar2ndarray( new Complex64( 1.0, 2.0 ), {
48+
* 'dtype': 'complex64'
49+
* });
5250
*
5351
* var z = caxpy( [ x, y, alpha ] );
54-
* // returns <ndarray>[ <Complex64>[ -2.0, 5.0 ], <Complex64>[ -4.0, 11.0 ], <Complex64>[ -6.0, 17.0 ], <Complex64>[ -8.0, 23.0 ] ]
52+
* // returns <ndarray>[ <Complex64>[ -2.0, 5.0 ], <Complex64>[ -4.0, 11.0 ], <Complex64>[ -6.0, 17.0 ], <Complex64>[ -8.0, 23.0 ], <Complex64>[ -10.0, 29.0 ] ]
5553
*
5654
* var bool = ( z === y );
5755
* // returns true

lib/node_modules/@stdlib/blas/base/ndarray/ccopy/README.md

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,10 @@ var ccopy = require( '@stdlib/blas/base/ndarray/ccopy' );
4141
Copies values from a one-dimensional single-precision complex floating-point ndarray `x` into a one-dimensional single-precision complex floating-point ndarray `y`.
4242

4343
```javascript
44-
var Complex64Array = require( '@stdlib/array/complex64' );
45-
var ndarray = require( '@stdlib/ndarray/base/ctor' );
44+
var Complex64Vector = require( '@stdlib/ndarray/vector/complex64' );
4645

47-
var xbuf = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
48-
var x = new ndarray( 'complex64', xbuf, [ 3 ], [ 1 ], 0, 'row-major' );
49-
50-
var ybuf = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] );
51-
var y = new ndarray( 'complex64', ybuf, [ 3 ], [ 1 ], 0, 'row-major' );
46+
var x = new Complex64Vector( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
47+
var y = new Complex64Vector( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] );
5248

5349
var z = ccopy( [ x, y ] );
5450
// returns <ndarray>[ <Complex64>[ 1.0, 2.0 ], <Complex64>[ 3.0, 4.0 ], <Complex64>[ 5.0, 6.0 ] ]
@@ -59,7 +55,10 @@ var bool = ( y === z );
5955

6056
The function has the following parameters:
6157

62-
- **arrays**: array-like object containing an input ndarray and an output ndarray.
58+
- **arrays**: array-like object containing the following ndarrays in order:
59+
60+
- input ndarray
61+
- output ndarray
6362

6463
</section>
6564

@@ -79,21 +78,18 @@ The function has the following parameters:
7978

8079
```javascript
8180
var discreteUniform = require( '@stdlib/random/array/discrete-uniform' );
82-
var Complex64Array = require( '@stdlib/array/complex64' );
83-
var ndarray = require( '@stdlib/ndarray/base/ctor' );
81+
var Complex64Vector = require( '@stdlib/ndarray/vector/complex64' );
8482
var ndarray2array = require( '@stdlib/ndarray/to-array' );
8583
var ccopy = require( '@stdlib/blas/base/ndarray/ccopy' );
8684

8785
var opts = {
8886
'dtype': 'float32'
8987
};
9088

91-
var xbuf = new Complex64Array( discreteUniform( 10, 0, 100, opts ) );
92-
var x = new ndarray( 'complex64', xbuf, [ xbuf.length ], [ 1 ], 0, 'row-major' );
89+
var x = new Complex64Vector( discreteUniform( 10, 0, 100, opts ) );
9390
console.log( ndarray2array( x ) );
9491

95-
var ybuf = new Complex64Array( discreteUniform( xbuf.length*2, 0, 10, opts ) );
96-
var y = new ndarray( 'complex64', ybuf, [ ybuf.length ], [ 1 ], 0, 'row-major' );
92+
var y = new Complex64Vector( discreteUniform( 10, 0, 10, opts ) );
9793
console.log( ndarray2array( y ) );
9894

9995
var out = ccopy( [ x, y ] );

0 commit comments

Comments
 (0)