8000 Auto-generated commit · stdlib-js/complex@3ed3721 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3ed3721

Browse files
committed
Auto-generated commit
1 parent 692fc4e commit 3ed3721

File tree

16 files changed

+1273
-76
lines changed

16 files changed

+1273
-76
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,3 +188,7 @@ jsconfig.json
188188
# Other editor files #
189189
######################
190190
.idea/
191+
192+
# Cursor #
193+
##########
194+
.cursorignore

CHANGELOG.md

Lines changed: 50 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
<section class="release" id="unreleased">
66

7-
## Unreleased (2025-02-04)
7+
## Unreleased (2025-02-16)
88

99
<section class="packages">
1010

@@ -44,6 +44,40 @@
4444

4545
<!-- /.package -->
4646

47+
<section class="package" id="complex-float32-base-mul-unreleased">
48+
49+
#### [@stdlib/complex/float32/base/mul](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/complex/float32/base/mul)
50+
51+
<details>
52+
53+
<section class="features">
54+
55+
##### Features
56+
57+
- [`d7154e2`](https://github.com/stdlib-js/stdlib/commit/d7154e2c7756ce51a9bbbf38848960ea988d4ea6) - add `strided` and `assign` APIs to `complex/float32/base/mul` [(#5205)](https://github.com/stdlib-js/stdlib/pull/5205)
58+
59+
</section>
60+
61+
<!-- /.features -->
62+
63+
<section class="issues">
64+
65+
##### Closed Issues
66+
67+
This release closes the following issue:
68+
69+
[#5203](https://github.com/stdlib-js/stdlib/issues/5203)
70+
71+
</section>
72+
73+
<!-- /.issues -->
74+
75+
</details>
76+
77+
</section>
78+
79+
<!-- /.package -->
80+
4781
<section class="package" id="complex-float64-base-unreleased">
4882

4983
#### [@stdlib/complex/float64/base](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/complex/float64/base)
@@ -173,14 +207,27 @@
173207

174208
<!-- /.breaking-changes -->
175209

210+
<section class="issues">
211+
212+
### Closed Issues
213+
214+
This release closes the following issue:
215+
216+
[#5203](https://github.com/stdlib-js/stdlib/issues/5203)
217+
218+
</section>
219+
220+
<!-- /.issues -->
221+
176222
<section class="contributors">
177223

178224
### Contributors
179225

180-
A total of 2 people contributed to this release. Thank you to the following contributors:
226+
A total of 3 people contributed to this release. Thank you to the following contributors:
181227

182228
- Athan Reines
183229
- Philipp Burckhardt
230+
- Shabareesh Shetty
184231

185232
</section>
186233

@@ -192,6 +239,7 @@ A total of 2 people contributed to this release. Thank you to the following cont
192239

193240
<details>
194241

242+
- [`d7154e2`](https://github.com/stdlib-js/stdlib/commit/d7154e2c7756ce51a9bbbf38848960ea988d4ea6) - **feat:** add `strided` and `assign` APIs to `complex/float32/base/mul` [(#5205)](https://github.com/stdlib-js/stdlib/pull/5205) _(by Shabareesh Shetty, Athan Reines, stdlib-bot)_
195243
- [`b957f93`](https://github.com/stdlib-js/stdlib/commit/b957f93bfacfa2b307db9b30a45fa48ce5b4488b) - **docs:** fix description _(by Athan Reines)_
196244
- [`8409bd1`](https://github.com/stdlib-js/stdlib/commit/8409bd17639c21c94be23d8498789fca5352892b) - **feat:** update namespace TypeScript declarations [(#4856)](https://github.com/stdlib-js/stdlib/pull/4856) _(by stdlib-bot)_
197245
- [`15204d7`](https://github.com/stdlib-js/stdlib/commit/15204d79d9a8dfeb4c520e6948813f29972e0aa2) - **docs:** update namespace table of contents [(#4858)](https://github.com/stdlib-js/stdlib/pull/4858) _(by stdlib-bot)_

CONTRIBUTORS

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,12 @@ Dominik Moritz <domoritz@gmail.com>
3535
Dorrin Sotoudeh <dorrinsotoudeh123@gmail.com>
3636
EuniceSim142 <77243938+EuniceSim142@users.noreply.github.com>
3737
Frank Kovacs <fran70kk@gmail.com>
38+
GK Bishnoi <gkishan1kyt@gmail.com>
39+
Gaurav <gaurav70380@gmail.com>
3840
Golden Kumar <103646877+AuenKr@users.noreply.github.com>
3941
Gunj Joshi <gunjjoshi8372@gmail.com>
40-
Gururaj Gurram <143020143+gururaj1512@users.noreply.github.com>
42+
Gururaj Gurram <gururajgurram1512@gmail.com>
43+
Harsh <149176984+hrshya@users.noreply.github.com>
4144
HarshaNP <96897754+GittyHarsha@users.noreply.github.com>
4245
Harshita Kalani <harshitakalani02@gmail.com>
4346
Hridyanshu <124202756+HRIDYANSHU054@users.noreply.github.com>
@@ -63,6 +66,7 @@ Marcus Fantham <mfantham@users.noreply.github.com>
6366
Matt Cochrane <matthew.cochrane.eng@gmail.com>
6467
Mihir Pandit <129577900+MSP20086@users.noreply.github.com>
6568
Milan Raj <rajsite@users.noreply.github.com>
69+
Mohammad Bin Aftab <48010758+MohammadBinAftab@users.noreply.github.com>
6670
Mohammad Kaif <mdkaifprofession@gmail.com>
6771
Momtchil Momtchev <momtchil@momtchev.com>
6872
Muhammad Haris <harriskhan047@outlook.com>
@@ -124,6 +128,8 @@ Vivek Maurya <vm8118134@gmail.com>
124128
Xiaochuan Ye <tap91624@gmail.com>
125129
Yaswanth Kosuru <116426380+yaswanthkosuru@users.noreply.github.com>
126130
Yernar Yergaziyev <yernar.yergaziyev@erg.kz>
131+
ekambains <bainsinbusiness@gmail.com>
127132
olenkabilonizhka <62379231+olenkabilonizhka@users.noreply.github.com>
133+
pranav-1720 <123018993+pranav-1720@users.noreply.github.com>
128134
rainn <88160429+AmCodesLame@users.noreply.github.com>
129135
rei2hu <reimu@reimu.ws>

float32/base/mul/README.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,61 @@ var im = imagf( v );
5858
// returns -1.0
5959
```
6060

61+
#### mul.assign( re1, im1, re2, im2, out, strideOut, offsetOut )
62+
63+
Multiplies two single-precision complex floating-point numbers and assigns results to a provided output array.
64+
65+
```javascript
66+
var Float32Array = require( '@stdlib/array/float32' );
67+
68+
var out = new Float32Array( 2 );
69+
var v = mul.assign( 5.0, 3.0, -2.0, 1.0, out, 1, 0 );
70+
// returns <Float32Array>[ -13.0, -1.0 ]
71+
72+
var bool = ( out === v );
73+
// returns true
74+
```
75+
76+
The function supports the following parameters:
77+
78+
- **re1**: real component of the first complex number.
79+
- **im1**: imaginary component of the first complex number.
80+
- **re2**: real component of the second complex number.
81+
- **im2**: imaginary component of the second complex number.
82+
- **out**: output array.
83+
- **strideOut**: stride length for `out`.
84+
- **offsetOut**: starting index for `out`.
85+
86+
#### mul.strided( z1, sz1, oz1, z2, sz2, oz2, out, so, oo )
87+
88+
Multiplies two single-precision complex floating-point numbers stored in real-valued strided array views and assigns results to a provided strided output array.
89+
90+
```javascript
91+
var Float32Array = require( '@stdlib/array/float32' );
92+
93+
var z1 = new Float32Array( [ 5.0, 3.0 ] );
94+
var z2 = new Float32Array( [ -2.0, 1.0 ] );
95+
var out = new Float32Array( 2 );
96+
97+
var v = mul.strided( z1, 1, 0, z2, 1, 0, out, 1, 0 );
98+
// returns <Float32Array>[ -13.0, -1.0 ]
99+
100+
var bool = ( out === v );
101+
// returns true
102+
```
103+
104+
The function supports the following parameters:
105+
106+
- **z1**: first complex number strided array view.
107+
- **sz1**: stride length for `z1`.
108+
- **oz1**: starting index for `z1`.
109+
- **z2**: second complex number strided array view.
110+
- **sz2**: stride length for `z2`.
111+
- **oz2**: starting index for `z2`.
112+
- **out**: output array.
113+
- **so**: stride length for `out`.
114+
- **oo**: starting index for `out`.
115+
61116
</section>
62117

63118
<!-- /.usage -->
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
/**
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2025 The Stdlib Authors.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
'use strict';
20+
21+
// MODULES //
22+
23+
var bench = require( '@stdlib/bench' );
24+
var uniform = require( '@stdlib/random/array/uniform' );
25+
var isnanf = require( '@stdlib/math/base/assert/is-nanf' );
26+
var Float32Array = require( '@stdlib/array/float32' );
27+
var pkg = require( './../package.json' ).name;
28+
var mul = require( './../lib' );
29+
30+
31+
// VARIABLES //
32+
33+
var options = {
34+
'dtype': 'float32'
35+
};
36+
37+
38+
// MAIN //
39+
40+
bench( pkg+':assign', function benchmark( b ) {
41+
var out;
42+
var re;
43+
var im;
44+
var N;
45+
var i;
46+
var j;
47+
var k;
48+
49+
N = 100;
50+
re = uniform( N, -500.0, 500.0, options );
51+
im = uniform( N, -500.0, 500.0, options );
52+
53+
out = new Float32Array( 2 );
54+
55+
b.tic();
56+
for ( i = 0; i < b.iterations; i++ ) {
57+
j = i % N;
58+
k = ( i+1 ) % N;
59+
out = mul.assign( re[ j ], im[ j ], re[ k ], im[ k ], out, 1, 0 );
60+
if ( typeof out !== 'object' ) {
61+
b.fail( 'should return an object' );
62+
}
63+
}
64+
b.toc();
65+
if ( isnanf( out[ 0 ] ) || isnanf( out[ 1 ] ) ) {
66+
b.fail( 'should not return NaN' );
67+
}
68+
b.pass( 'benchmark finished' );
69+
b.end();
70+
});
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
/**
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2025 The Stdlib Authors.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
'use strict';
20+
21+
// MODULES //
22+
23+
var bench = require( '@stdlib/bench' );
24+
var uniform = require( '@stdlib/random/array/uniform' );
25+
var isnanf = require( '@stdlib/math/base/assert/is-nanf' );
26+
var Float32Array = require( '@stdlib/array/float32' );
27+
var pkg = require( './../package.json' ).name;
28+
var mul = require( './../lib' );
29+
30+
31+
// VARIABLES //
32+
33+
var options = {
34+
'dtype': 'float32'
35+
};
36+
37+
38+
// MAIN //
39+
40+
bench( pkg+':strided', function benchmark( b ) {
41+
var out;
42+
var z1;
43+
var z2;
44+
var N;
45+
var i;
46+
var j;
47+
48+
N = 50;
49+
z1 = uniform( N*2, -500.0, 500.0, options );
50+
z2 = uniform( N*2, -500.0, 500.0, options );
51+
52+
out = new Float32Array( 2 );
53+
54+
b.tic();
55+
for ( i = 0; i < b.iterations; i++ ) {
56+
j = ( i % N ) * 2;
57+
out = mul.strided( z1, 1, j, z2, 1, j, out, 1, 0 );
58+
if ( typeof out !== 'object' ) {
59+
b.fail( 'should return an object' );
60+
}
61+
}
62+
b.toc();
63+
if ( isnanf( out[ 0 ] ) || isnanf( out[ 1 ] ) ) {
64+
b.fail( 'should not return NaN' );
65+
}
66+
b.pass( 'benchmark finished' );
67+
b.end();
68+
});

0 commit comments

Comments
 (0)
0