Skip to content

Commit 57e6e8b

Browse files
authored
chore: propagate blas/base/ndarray/* modernization fixes to sibling packages
PR-URL: #11742 Reviewed-by: Athan Reines <kgryte@gmail.com>
1 parent c660c8e commit 57e6e8b

10 files changed

Lines changed: 100 additions & 40 deletions

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ var alpha = scalar2ndarray( new Complex64( 1.0, 2.0 ), {
5454
var z = caxpy( [ x, y, alpha ] );
5555
// returns <ndarray>[ <Complex64>[ -2.0, 5.0 ], <Complex64>[ -4.0, 11.0 ], <Complex64>[ -6.0, 17.0 ] ]
5656

57-
var bool = ( y === z );
57+
var bool = ( z === y );
5858
// returns true
5959
```
6060

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

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ var tape = require( 'tape' );
2424
var isSameComplex64Array = require( '@stdlib/assert/is-same-complex64array' );
2525
var Complex64Array = require( '@stdlib/array/complex64' );
2626
var Complex64 = require( '@stdlib/complex/float32/ctor' );
27-
var scalar2ndarray = require( '@stdlib/ndarray/base/from-scalar' );
27+
var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' );
2828
var ndarray = require( '@stdlib/ndarray/base/ctor' );
2929
var getData = require( '@stdlib/ndarray/data-buffer' );
3030
var caxpy = require( './../lib' );
@@ -95,7 +95,9 @@ tape( 'the function multiplies a one-dimensional ndarray `x` by a constant `alph
9595
]);
9696
x = vector( xbuf, 5, 1, 0 );
9797
y = vector( ybuf, 5, 1, 0 );
98-
alpha = scalar2ndarray( new Complex64( 2.0, 2.0 ), 'complex64', 'row-major' );
98+
alpha = scalar2ndarray( new Complex64( 2.0, 2.0 ), {
99+
'dtype': 'complex64'
100+
});
99101

100102
v = caxpy( [ x, y, alpha ] );
101103

@@ -128,7 +130,9 @@ tape( 'the function multiplies a one-dimensional ndarray `x` by a constant `alph
128130
]);
129131
x = vector( xbuf, 2, 1, 0 );
130132
y = vector( ybuf, 2, 1, 0 );
131-
alpha = scalar2ndarray( new Complex64( 2.0, 2.0 ), 'complex64', 'row-major' );
133+
alpha = scalar2ndarray( new Complex64( 2.0, 2.0 ), {
134+
'dtype': 'complex64'
135+
});
132136

133137
v = caxpy( [ x, y, alpha ] );
134138

@@ -157,7 +161,9 @@ tape( 'if provided empty ndarrays, the function returns the output ndarray uncha
157161
ybuf = new Complex64Array( [] );
158162
x = vector( xbuf, 0, 1, 0 );
159163
y = vector( ybuf, 0, 1, 0 );
160-
alpha = scalar2ndarray( new Complex64( 1.0, 2.0 ), 'complex64', 'row-major' );
164+
alpha = scalar2ndarray( new Complex64( 1.0, 2.0 ), {
165+
'dtype': 'complex64'
166+
});
161167

162168
v = caxpy( [ x, y, alpha ] );
163169

@@ -204,7 +210,9 @@ tape( 'the function supports one-dimensional ndarrays having non-unit strides',
204210
1.0
205211
]);
206212
y = vector( ybuf, 3, 1, 0 );
207-
alpha = scalar2ndarray( new Complex64( 2.0, 2.0 ), 'complex64', 'row-major' );
213+
alpha = scalar2ndarray( new Complex64( 2.0, 2.0 ), {
214+
'dtype': 'complex64'
215+
});
208216

209217
v = caxpy( [ x, y, alpha ] );
210218

@@ -261,7 +269,9 @@ tape( 'the function supports one-dimensional ndarrays having negative strides',
261269
10.0
262270
]);
263271
y = vector( ybuf, 3, -1, 2 );
264-
alpha = scalar2ndarray( new Complex64( 2.0, 2.0 ), 'complex64', 'row-major' );
272+
alpha = scalar2ndarray( new Complex64( 2.0, 2.0 ), {
273+
'dtype': 'complex64'
274+
});
265275

266276
v = caxpy( [ x, y, alpha ] );
267277

@@ -330,7 +340,9 @@ tape( 'the function supports one-dimensional ndarrays having non-zero offsets',
330340
8.0
331341
]);
332342
y = vector( ybuf, 4, 1, 2 );
333-
alpha = scalar2ndarray( new Complex64( 2.0, 2.0 ), 'complex64', 'row-major' );
343+
alpha = scalar2ndarray( new Complex64( 2.0, 2.0 ), {
344+
'dtype': 'complex64'
345+
});
334346

335347
v = caxpy( [ x, y, alpha ] );
336348

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ var y = new Complex64Vector( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] );
4949
var z = ccopy( [ x, y ] );
5050
// returns <ndarray>[ <Complex64>[ 1.0, 2.0 ], <Complex64>[ 3.0, 4.0 ], <Complex64>[ 5.0, 6.0 ] ]
5151

52-
var bool = ( y === z );
52+
var bool = ( z === y );
5353
// returns true
5454
```
5555

lib/node_modules/@stdlib/blas/base/ndarray/daxpy/test/test.js

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
var tape = require( 'tape' );
2424
var isSameFloat64Array = require( '@stdlib/assert/is-same-float64array' );
2525
var Float64Array = require( '@stdlib/array/float64' );
26-
var scalar2ndarray = require( '@stdlib/ndarray/base/from-scalar' );
26+
var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' );
2727
var ndarray = require( '@stdlib/ndarray/base/ctor' );
2828
var getData = require( '@stdlib/ndarray/data-buffer' );
2929
var daxpy = require( './../lib' );
@@ -72,7 +72,9 @@ tape( 'the function multiplies a one-dimensional ndarray `x` by a constant `alph
7272
ybuf = new Float64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] );
7373
x = vector( xbuf, 5, 1, 0 );
7474
y = vector( ybuf, 5, 1, 0 );
75-
alpha = scalar2ndarray( 2.0, 'float64', 'row-major' );
75+
alpha = scalar2ndarray( 2.0, {
76+
'dtype': 'float64'
77+
});
7678

7779
v = daxpy( [ x, y, alpha ] );
7880

@@ -84,7 +86,9 @@ tape( 'the function multiplies a one-dimensional ndarray `x` by a constant `alph
8486
ybuf = new Float64Array( [ 1.0, 1.0 ] );
8587
x = vector( xbuf, 2, 1, 0 );
8688
y = vector( ybuf, 2, 1, 0 );
87-
alpha = scalar2ndarray( 2.0, 'float64', 'row-major' );
89+
alpha = scalar2ndarray( 2.0, {
90+
'dtype': 'float64'
91+
});
8892

8993
v = daxpy( [ x, y, alpha ] );
9094

@@ -108,7 +112,9 @@ tape( 'if provided empty ndarrays, the function returns the output ndarray uncha
108112
ybuf = new Float64Array( [] );
109113
x = vector( xbuf, 0, 1, 0 );
110114
y = vector( ybuf, 0, 1, 0 );
111-
alpha = scalar2ndarray( 5.0, 'float64', 'row-major' );
115+
alpha = scalar2ndarray( 5.0, {
116+
'dtype': 'float64'
117+
});
112118

113119
v = daxpy( [ x, y, alpha ] );
114120

@@ -145,7 +151,9 @@ tape( 'the function supports one-dimensional ndarrays having non-unit strides',
145151
1.0
146152
]);
147153
y = vector( ybuf, 3, 1, 0 );
148-
alpha = scalar2ndarray( 2.0, 'float64', 'row-major' );
154+
alpha = scalar2ndarray( 2.0, {
155+
'dtype': 'float64'
156+
});
149157

150158
v = daxpy( [ x, y, alpha ] );
151159

@@ -181,7 +189,9 @@ tape( 'the function supports one-dimensional ndarrays having negative strides',
181189
10.0
182190
]);
183191
y = vector( ybuf, 3, -1, 2 );
184-
alpha = scalar2ndarray( 3.0, 'float64', 'row-major' );
192+
alpha = scalar2ndarray( 3.0, {
193+
'dtype': 'float64'
194+
});
185195

186196
v = daxpy( [ x, y, alpha ] );
187197

@@ -223,7 +233,9 @@ tape( 'the function supports one-dimensional ndarrays having non-zero offsets',
223233
8.0
224234
]);
225235
y = vector( ybuf, 4, 1, 2 );
226-
alpha = scalar2ndarray( 3.0, 'float64', 'row-major' );
236+
alpha = scalar2ndarray( 3.0, {
237+
'dtype': 'float64'
238+
});
227239

228240
v = daxpy( [ x, y, alpha ] );
229241

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ var z = dswap( [ x, y ] );
5454
// x => <ndarray>[ 6.0, 7.0, 8.0, 9.0, 10.0 ]
5555
// y => <ndarray>[ 1.0, 2.0, 3.0, 4.0, 5.0 ]
5656

57-
var bool = ( y === z );
57+
var bool = ( z === y );
5858
// returns true
5959
```
6060

lib/node_modules/@stdlib/blas/base/ndarray/gaxpy/test/test.js

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

2323
var tape = require( 'tape' );
2424
var isSameArray = require( '@stdlib/assert/is-same-array' );
25-
var scalar2ndarray = require( '@stdlib/ndarray/base/from-scalar' );
25+
var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' );
2626
var ndarray = require( '@stdlib/ndarray/base/ctor' );
2727
var getData = require( '@stdlib/ndarray/data-buffer' );
2828
var gaxpy = require( './../lib' );
@@ -71,7 +71,9 @@ tape( 'the function multiplies a one-dimensional ndarray `x` by a constant `alph
7171
ybuf = [ 1.0, 1.0, 1.0, 1.0, 1.0 ];
7272
x = vector( xbuf, 5, 1, 0 );
7373
y = vector( ybuf, 5, 1, 0 );
74-
alpha = scalar2ndarray( 2.0, 'generic', 'row-major' );
74+
alpha = scalar2ndarray( 2.0, {
75+
'dtype': 'generic'
76+
});
7577

7678
v = gaxpy( [ x, y, alpha ] );
7779

@@ -83,7 +85,9 @@ tape( 'the function multiplies a one-dimensional ndarray `x` by a constant `alph
8385
ybuf = [ 1.0, 1.0 ];
8486
x = vector( xbuf, 2, 1, 0 );
8587
y = vector( ybuf, 2, 1, 0 );
86-
alpha = scalar2ndarray( 2.0, 'generic', 'row-major' );
88+
alpha = scalar2ndarray( 2.0, {
89+
'dtype': 'generic'
90+
});
8791

8892
v = gaxpy( [ x, y, alpha ] );
8993

@@ -107,7 +111,9 @@ tape( 'if provided empty ndarrays, the function returns the output ndarray uncha
107111
ybuf = [];
108112
x = vector( xbuf, 0, 1, 0 );
109113
y = vector( ybuf, 0, 1, 0 );
110-
alpha = scalar2ndarray( 5.0, 'generic', 'row-major' );
114+
alpha = scalar2ndarray( 5.0, {
115+
'dtype': 'generic'
116+
});
111117

112118
v = gaxpy( [ x, y, alpha ] );
113119

@@ -144,7 +150,9 @@ tape( 'the function supports one-dimensional ndarrays having non-unit strides',
144150
1.0
145151
];
146152
y = vector( ybuf, 3, 1, 0 );
147-
alpha = scalar2ndarray( 2.0, 'generic', 'row-major' );
153+
alpha = scalar2ndarray( 2.0, {
154+
'dtype': 'generic'
155+
});
148156

149157
v = gaxpy( [ x, y, alpha ] );
150158

@@ -180,7 +188,9 @@ tape( 'the function supports one-dimensional ndarrays having negative strides',
180188
10.0
181189
];
182190
y = vector( ybuf, 3, -1, 2 );
183-
alpha = scalar2ndarray( 3.0, 'generic', 'row-major' );
191+
alpha = scalar2ndarray( 3.0, {
192+
'dtype': 'generic'
193+
});
184194

185195
v = gaxpy( [ x, y, alpha ] );
186196

@@ -222,7 +232,9 @@ tape( 'the function supports one-dimensional ndarrays having non-zero offsets',
222232
8.0
223233
];
224234
y = vector( ybuf, 4, 1, 2 );
225-
alpha = scalar2ndarray( 3.0, 'generic', 'row-major' );
235+
alpha = scalar2ndarray( 3.0, {
236+
'dtype': 'generic'
237+
});
226238

227239
v = gaxpy( [ x, y, alpha ] );
228240

lib/node_modules/@stdlib/blas/base/ndarray/saxpy/test/test.js

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
var tape = require( 'tape' );
2424
var isSameFloat32Array = require( '@stdlib/assert/is-same-float32array' );
2525
var Float32Array = require( '@stdlib/array/float32' );
26-
var scalar2ndarray = require( '@stdlib/ndarray/base/from-scalar' );
26+
var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' );
2727
var ndarray = require( '@stdlib/ndarray/base/ctor' );
2828
var getData = require( '@stdlib/ndarray/data-buffer' );
2929
var saxpy = require( './../lib' );
@@ -72,7 +72,9 @@ tape( 'the function multiplies a one-dimensional ndarray `x` by a constant `alph
7272
ybuf = new Float32Array( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] );
7373
x = vector( xbuf, 5, 1, 0 );
7474
y = vector( ybuf, 5, 1, 0 );
75-
alpha = scalar2ndarray( 2.0, 'float32', 'row-major' );
75+
alpha = scalar2ndarray( 2.0, {
76+
'dtype': 'float32'
77+
});
7678

7779
v = saxpy( [ x, y, alpha ] );
7880

@@ -84,7 +86,9 @@ tape( 'the function multiplies a one-dimensional ndarray `x` by a constant `alph
8486
ybuf = new Float32Array( [ 1.0, 1.0 ] );
8587
x = vector( xbuf, 2, 1, 0 );
8688
y = vector( ybuf, 2, 1, 0 );
87-
alpha = scalar2ndarray( 2.0, 'float32', 'row-major' );
89+
alpha = scalar2ndarray( 2.0, {
90+
'dtype': 'float32'
91+
});
8892

8993
v = saxpy( [ x, y, alpha ] );
9094

@@ -108,7 +112,9 @@ tape( 'if provided empty ndarrays, the function returns the output ndarray uncha
108112
ybuf = new Float32Array( [] );
109113
x = vector( xbuf, 0, 1, 0 );
110114
y = vector( ybuf, 0, 1, 0 );
111-
alpha = scalar2ndarray( 5.0, 'float32', 'row-major' );
115+
alpha = scalar2ndarray( 5.0, {
116+
'dtype': 'float32'
117+
});
112118

113119
v = saxpy( [ x, y, alpha ] );
114120

@@ -145,7 +151,9 @@ tape( 'the function supports one-dimensional ndarrays having non-unit strides',
145151
1.0
146152
]);
147153
y = vector( ybuf, 3, 1, 0 );
148-
alpha = scalar2ndarray( 2.0, 'float32', 'row-major' );
154+
alpha = scalar2ndarray( 2.0, {
155+
'dtype': 'float32'
156+
});
149157

150158
v = saxpy( [ x, y, alpha ] );
151159

@@ -181,7 +189,9 @@ tape( 'the function supports one-dimensional ndarrays having negative strides',
181189
10.0
182190
]);
183191
y = vector( ybuf, 3, -1, 2 );
184-
alpha = scalar2ndarray( 3.0, 'float32', 'row-major' );
192+
alpha = scalar2ndarray( 3.0, {
193+
'dtype': 'float32'
194+
});
185195

186196
v = saxpy( [ x, y, alpha ] );
187197

@@ -223,7 +233,9 @@ tape( 'the function supports one-dimensional ndarrays having non-zero offsets',
223233
8.0
224234
]);
225235
y = vector( ybuf, 4, 1, 2 );
226-
alpha = scalar2ndarray( 3.0, 'float32', 'row-major' );
236+
alpha = scalar2ndarray( 3.0, {
237+
'dtype': 'float32'
238+
});
227239

228240
v = saxpy( [ x, y, alpha ] );
229241

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ var alpha = scalar2ndarray( new Complex128( 1.0, 2.0 ), {
5454
var z = zaxpy( [ x, y, alpha ] );
5555
// returns <ndarray>[ <Complex128>[ -2.0, 5.0 ], <Complex128>[ -4.0, 11.0 ], <Complex128>[ -6.0, 17.0 ] ]
5656

57-
var bool = ( y === z );
57+
var bool = ( z === y );
5858
// returns true
5959
```
6060

0 commit comments

Comments
 (0)