Skip to content

Commit b70066c

Browse files
authored
Merge branch 'develop' into blas/gcartesian-square
2 parents d34dc87 + 1481c95 commit b70066c

121 files changed

Lines changed: 3993 additions & 283 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.

docs/migration-guides/numpy/data/numpy_2_4.csv

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -153,13 +153,13 @@ eye,(planned)
153153
f2py,N/A
154154
fabs,(planned)
155155
fft,(planned)
156-
fill_diagonal,(planned)
156+
fill_diagonal,@stdlib/ndarray/fill-diagonal
157157
finfo,(planned)
158158
fix,N/A
159159
flatiter,(planned)
160160
flatnonzero,(planned)
161161
flexible,N/A
162-
flip,(planned)
162+
flip,@stdlib/ndarray/reverse-dimensions
163163
fliplr,@stdlib/ndarray/fliplr
164164
flipud,@stdlib/ndarray/flipud
165165
float16,@stdlib/ndarray/dtypes
@@ -178,7 +178,7 @@ frexp,(planned)
178178
from_dlpack,(planned)
179179
frombuffer,N/A
180180
fromfile,(planned)
181-
fromfunction,(planned)
181+
fromfunction,@stdlib/ndarray/full-by
182182
fromiter,(planned)
183183
frompyfunc,(planned)
184184
fromregex,(planned)
@@ -212,7 +212,7 @@ i0,(planned)
212212
identity,(planned)
213213
iinfo,(planned)
214214
imag,(planned)
215-
in1d,(planned)
215+
in1d,N/A
216216
index_exp,N/A
217217
indices,(planned)
218218
inexact,N/A
@@ -259,9 +259,9 @@ less,(planned)
259259
less_equal,(planned)
260260
lexsort,(planned)
261261
lib,N/A
262-
linalg,(planned)
262+
linalg,N/A
263263
linspace,@stdlib/blas/ext/linspace
264-
little_endian,N/A
264+
little_endian,@stdlib/assert/is-little-endian
265265
load,(planned)
266266
loadtxt,(planned)
267267
log,(planned)
@@ -282,7 +282,7 @@ ma,(planned)
282282
mask_indices,(planned)
283283
matmul,(planned)
284284
matrix,(planned)
285-
matrix_transpose,(planned)
285+
matrix_transpose,@stdlib/ndarray/transpose
286286
max,@stdlib/stats/max
287287
maximum,(planned)
288288
may_share_memory,(planned)

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ The namespace exposes the following APIs:
4747

4848
- <span class="signature">[`caxpy( arrays )`][@stdlib/blas/base/ndarray/caxpy]</span><span class="delimiter">: </span><span class="description">multiply a one-dimensional single-precision complex floating-point ndarray `x` by a constant `alpha` and add the result to a one-dimensional single-precision complex floating-point ndarray `y`.</span>
4949
- <span class="signature">[`ccopy( arrays )`][@stdlib/blas/base/ndarray/ccopy]</span><span class="delimiter">: </span><span class="description">copy values from a one-dimensional single-precision complex floating-point ndarray `x` into a one-dimensional single-precision complex floating-point ndarray `y`.</span>
50+
- <span class="signature">[`cscal( arrays )`][@stdlib/blas/base/ndarray/cscal]</span><span class="delimiter">: </span><span class="description">multiply a one-dimensional single-precision complex floating-point ndarray by a scalar constant.</span>
5051
- <span class="signature">[`cswap( arrays )`][@stdlib/blas/base/ndarray/cswap]</span><span class="delimiter">: </span><span class="description">interchange two one-dimensional single-precision complex floating-point ndarrays.</span>
5152
- <span class="signature">[`dasum( arrays )`][@stdlib/blas/base/ndarray/dasum]</span><span class="delimiter">: </span><span class="description">calculate the sum of absolute values for all elements in a one-dimensional double-precision floating-point ndarray.</span>
5253
- <span class="signature">[`daxpy( arrays )`][@stdlib/blas/base/ndarray/daxpy]</span><span class="delimiter">: </span><span class="description">multiply a one-dimensional double-precision floating-point ndarray `x` by a constant `alpha` and add the result to a one-dimensional double-precision floating-point ndarray `y`.</span>
@@ -58,6 +59,7 @@ The namespace exposes the following APIs:
5859
- <span class="signature">[`gaxpy( arrays )`][@stdlib/blas/base/ndarray/gaxpy]</span><span class="delimiter">: </span><span class="description">multiply a one-dimensional ndarray `x` by a constant `alpha` and add the result to a one-dimensional ndarray `y`.</span>
5960
- <span class="signature">[`gcopy( arrays )`][@stdlib/blas/base/ndarray/gcopy]</span><span class="delimiter">: </span><span class="description">copy values from a one-dimensional ndarray `x` into a one-dimensional ndarray `y`.</span>
6061
- <span class="signature">[`gdot( arrays )`][@stdlib/blas/base/ndarray/gdot]</span><span class="delimiter">: </span><span class="description">calculate the dot product of two one-dimensional ndarrays.</span>
62+
- <span class="signature">[`gscal( arrays )`][@stdlib/blas/base/ndarray/gscal]</span><span class="delimiter">: </span><span class="description">multiply a one-dimensional ndarray by a scalar constant.</span>
6163
- <span class="signature">[`gswap( arrays )`][@stdlib/blas/base/ndarray/gswap]</span><span class="delimiter">: </span><span class="description">interchange two one-dimensional ndarrays.</span>
6264
- <span class="signature">[`sasum( arrays )`][@stdlib/blas/base/ndarray/sasum]</span><span class="delimiter">: </span><span class="description">calculate the sum of absolute values for all elements in a one-dimensional single-precision floating-point ndarray.</span>
6365
- <span class="signature">[`saxpy( arrays )`][@stdlib/blas/base/ndarray/saxpy]</span><span class="delimiter">: </span><span class="description">multiply a one-dimensional single-precision floating-point ndarray `x` by a constant `alpha` and add the result to a one-dimensional single-precision floating-point ndarray `y`.</span>
@@ -114,6 +116,8 @@ console.log( objectKeys( ns ) );
114116

115117
[@stdlib/blas/base/ndarray/ccopy]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/base/ndarray/ccopy
116118

119+
[@stdlib/blas/base/ndarray/cscal]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/base/ndarray/cscal
120+
117121
[@stdlib/blas/base/ndarray/cswap]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/base/ndarray/cswap
118122

119123
[@stdlib/blas/base/ndarray/dasum]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/base/ndarray/dasum
@@ -136,6 +140,8 @@ console.log( objectKeys( ns ) );
136140

137141
[@stdlib/blas/base/ndarray/gdot]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/base/ndarray/gdot
138142

143+
[@stdlib/blas/base/ndarray/gscal]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/base/ndarray/gscal
144+
139145
[@stdlib/blas/base/ndarray/gswap]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/base/ndarray/gswap
140146

141147
[@stdlib/blas/base/ndarray/sasum]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/base/ndarray/sasum

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

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

2323
import caxpy = require( '@stdlib/blas/base/ndarray/caxpy' );
2424
import ccopy = require( '@stdlib/blas/base/ndarray/ccopy' );
25+
import cscal = require( '@stdlib/blas/base/ndarray/cscal' );
2526
import cswap = require( '@stdlib/blas/base/ndarray/cswap' );
2627
import dasum = require( '@stdlib/blas/base/ndarray/dasum' );
2728
import daxpy = require( '@stdlib/blas/base/ndarray/daxpy' );
@@ -33,6 +34,7 @@ import gasum = require( '@stdlib/blas/base/ndarray/gasum' );
3334
import gaxpy = require( '@stdlib/blas/base/ndarray/gaxpy' );
3435
import gcopy = require( '@stdlib/blas/base/ndarray/gcopy' );
3536
import gdot = require( '@stdlib/blas/base/ndarray/gdot' );
37+
import gscal = require( '@stdlib/blas/base/ndarray/gscal' );
3638
import gswap = require( '@stdlib/blas/base/ndarray/gswap' );
3739
import sasum = require( '@stdlib/blas/base/ndarray/sasum' );
3840
import saxpy = require( '@stdlib/blas/base/ndarray/saxpy' );
@@ -109,6 +111,38 @@ interface Namespace {
109111
*/
110112
ccopy: typeof ccopy;
111113

114+
/**
115+
* Multiplies a one-dimensional single-precision complex floating-point ndarray by a scalar constant.
116+
*
117+
* ## Notes
118+
*
119+
* - The function expects the following ndarrays:
120+
*
121+
* - a one-dimensional input ndarray.
122+
* - a zero-dimensional ndarray containing a scalar constant.
123+
*
124+
* @param arrays - array-like object containing ndarrays
125+
* @returns input ndarray
126+
*
127+
* @example
128+
* var Complex64Vector = require( '@stdlib/ndarray/vector/complex64' );
129+
* var Complex64 = require( '@stdlib/complex/float32/ctor' );
130+
* var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' );
131+
*
132+
* var x = new Complex64Vector( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
133+
*
134+
* var alpha = scalar2ndarray( new Complex64( 2.0, 0.0 ), {
135+
* 'dtype': 'complex64'
136+
* });
137+
*
138+
* var y = ns.cscal( [ x, alpha ] );
139+
* // returns <ndarray>[ <Complex64>[ 2.0, 4.0 ], <Complex64>[ 6.0, 8.0 ], <Complex64>[ 10.0, 12.0 ] ]
140+
*
141+
* var bool = ( y === x );
142+
* // returns true
143+
*/
144+
cscal: typeof cscal;
145+
112146
/**
113147
* Interchanges two one-dimensional single-precision complex floating-point ndarrays.
114148
*
@@ -408,6 +442,37 @@ interface Namespace {
408442
*/
409443
gdot: typeof gdot;
410444

445+
/**
446+
* Multiplies a one-dimensional ndarray by a scalar constant.
447+
*
448+
* ## Notes
449+
*
450+
* - The function expects the following ndarrays:
451+
*
452+
* - a one-dimensional input ndarray.
453+
* - a zero-dimensional ndarray containing a scalar constant.
454+
*
455+
* @param arrays - array-like object containing ndarrays
456+
* @returns input ndarray
457+
*
458+
* @example
459+
* var vector = require( '@stdlib/ndarray/vector/ctor' );
460+
* var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' );
461+
*
462+
* var x = vector( [ 1.0, 2.0, 3.0, 4.0, 5.0 ], 'generic' );
463+
*
464+
* var alpha = scalar2ndarray( 5.0, {
465+
* 'dtype': 'generic'
466+
* });
467+
*
468+
* var y = ns.gscal( [ x, alpha ] );
469+
* // returns <ndarray>[ 5.0, 10.0, 15.0, 20.0, 25.0 ]
470+
*
471+
* var bool = ( y === x );
472+
* // returns true
473+
*/
474+
gscal: typeof gscal;
475+
411476
/**
412477
* Interchanges two one-dimensional ndarrays.
413478
*

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,15 @@ setReadOnly( ns, 'zaxpy', require( '@stdlib/blas/base/ndarray/zaxpy' ) );
252252
*/
253253
setReadOnly( ns, 'zcopy', require( '@stdlib/blas/base/ndarray/zcopy' ) );
254254

255+
/**
256+
* @name zscal
257+
* @memberof ns
258+
* @readonly
259+
* @type {Function}
260+
* @see {@link module:@stdlib/blas/base/ndarray/zscal}
261+
*/
262+
setReadOnly( ns, 'zscal', require( '@stdlib/blas/base/ndarray/zscal' ) );
263+
255264
/**
256265
* @name zswap
257266
* @memberof ns
Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
<!--
2+
3+
@license Apache-2.0
4+
5+
Copyright (c) 2026 The Stdlib Authors.
6+
7+
Licensed under the Apache License, Version 2.0 (the "License");
8+
you may not use this file except in compliance with the License.
9+
You may obtain a copy of the License at
10+
11+
http://www.apache.org/licenses/LICENSE-2.0
12+
13+
Unless required by applicable law or agreed to in writing, software
14+
distributed under the License is distributed on an "AS IS" BASIS,
15+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
See the License for the specific language governing permissions and
17+
limitations under the License.
18+
19+
-->
20+
21+
# zscal
22+
23+
> Multiply a one-dimensional double-precision complex floating-point ndarray by a scalar constant.
24+
25+
<section class="intro">
26+
27+
</section>
28+
29+
<!-- /.intro -->
30+
31+
<section class="usage">
32+
33+
## Usage
34+
35+
```javascript
36+
var zscal = require( '@stdlib/blas/base/ndarray/zscal' );
37+
```
38+
39+
#### zscal( arrays )
40+
41+
Multiplies a one-dimensional double-precision complex floating-point ndarray by a scalar constant.
42+
43+
```javascript
44+
var Complex128Vector = require( '@stdlib/ndarray/vector/complex128' );
45+
var Complex128 = require( '@stdlib/complex/float64/ctor' );
46+
var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' );
47+
48+
var x = new Complex128Vector( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
49+
50+
var alpha = scalar2ndarray( new Complex128( 2.0, 0.0 ), {
51+
'dtype': 'complex128'
52+
});
53+
54+
var y = zscal( [ x, alpha ] );
55+
// returns <ndarray>[ <Complex128>[ 2.0, 4.0 ], <Complex128>[ 6.0, 8.0 ], <Complex128>[ 10.0, 12.0 ] ]
56+
57+
var bool = ( y === x );
58+
// returns true
59+
```
60+
61+
The function has the following parameters:
62+
63+
- **arrays**: array-like object containing the following ndarrays:
64+
65+
- a one-dimensional input ndarray.
66+
- a zero-dimensional ndarray containing a scalar constant.
67+
68+
</section>
69+
70+
<!-- /.usage -->
71+
72+
<section class="notes">
73+
74+
</section>
75+
76+
<!-- /.notes -->
77+
78+
<section class="examples">
79+
80+
## Examples
81+
82+
<!-- eslint no-undef: "error" -->
83+
84+
```javascript
85+
var discreteUniform = require( '@stdlib/random/array/discrete-uniform' );
86+
var Complex128Vector = require( '@stdlib/ndarray/vector/complex128' );
87+
var Complex128 = require( '@stdlib/complex/float64/ctor' );
88+
var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' );
89+
var ndarray2array = require( '@stdlib/ndarray/to-array' );
90+
var zscal = require( '@stdlib/blas/base/ndarray/zscal' );
91+
92+
var opts = {
93+
'dtype': 'float64'
94+
};
95+
96+
var x = new Complex128Vector( discreteUniform( 10, 0, 100, opts ) );
97+
console.log( ndarray2array( x ) );
98+
99+
var alpha = scalar2ndarray( new Complex128( 2.0, 0.0 ), {
100+
'dtype': 'complex128'
101+
});
102+
103+
var out = zscal( [ x, alpha ] );
104+
console.log( ndarray2array( out ) );
105+
```
106+
107+
</section>
108+
109+
<!-- /.examples -->
110+
111+
<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->
112+
113+
<section class="related">
114+
115+
</section>
116+
117+
<!-- /.related -->
118+
119+
<!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
120+
121+
<section class="links">
122+
123+
</section>
124+
125+
<!-- /.links -->

0 commit comments

Comments
 (0)