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

Skip to content

Commit ad1b052

Browse files
committed
Auto-generated commit
1 parent 1266c6e commit ad1b052

File tree

19 files changed

+1238
-82
lines changed

19 files changed

+1238
-82
lines changed

.editorconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ indent_style = tab
8686
[*.{f,f.txt}]
8787
indent_style = space
8888
indent_size = 2
89-
insert_final_newline = false
9089

9190
# Set properties for shell files:
9291
[*.{sh,sh.txt}]

.github/.keepalive

Lines changed: 0 additions & 1 deletion
This file was deleted.

CHANGELOG.md

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

7-
## Unreleased (2024-12-30)
7+
## Unreleased (2025-01-17)
88

99
<section class="packages">
1010

@@ -44,6 +44,29 @@
4444

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

47+
<section class="package" id="complex-float64-base-mul-unreleased">
48+
49+
#### [@stdlib/complex/float64/base/mul](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/complex/float64/base/mul)
50+
51+
<details>
52+
53+
<section class="features">
54+
55+
##### Features
56+
57+
- [`a0aef8f`](https://github.com/stdlib-js/stdlib/commit/a0aef8ff6010029008236151a684d1295a66f6a7) - add `strided` API
58+
- [`e93b466`](https://github.com/stdlib-js/stdlib/commit/e93b4667550eed6470a805d8e244764c6fe26525) - add `assign` method
59+
60+
</section>
61+
62+
<!-- /.features -->
63+
64+
</details>
65+
66+
</section>
67+
68+
<!-- /.package -->
69+
4770
</section>
4871

4972
<!-- /.packages -->
@@ -79,6 +102,8 @@ A total of 2 people contributed to this release. Thank you to the following cont
79102

80103
<details>
81104

105+
- [`a0aef8f`](https://github.com/stdlib-js/stdlib/commit/a0aef8ff6010029008236151a684d1295a66f6a7) - **feat:** add `strided` API _(by Athan Reines)_
106+
- [`e93b466`](https://github.com/stdlib-js/stdlib/commit/e93b4667550eed6470a805d8e244764c6fe26525) - **feat:** add `assign` method _(by Athan Reines)_
82107
- [`40308a8`](https://github.com/stdlib-js/stdlib/commit/40308a8953dd480537d4c4359cc6e09f679e3ec1) - **build:** update configurations _(by Athan Reines)_
83108
- [`8b1548f`](https://github.com/stdlib-js/stdlib/commit/8b1548fb45c1ff131f5edac20cb984344a2d28ec) - **feat:** update namespace TypeScript declarations [(#3190)](https://github.com/stdlib-js/stdlib/pull/3190) _(by stdlib-bot, Philipp Burckhardt)_
84109

CONTRIBUTORS

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ Daniel Killenberger <daniel.killenberger@gmail.com>
2727
Daniel Yu <40680511+Daniel777y@users.noreply.github.com>
2828
Debashis Maharana <debashismaharana7854@gmail.com>
2929
Desh Deepak Kant <118960904+DeshDeepakKant@users.noreply.github.com>
30+
Dhruv Arvind Singh <154677013+DhruvArvindSingh@users.noreply.github.com>
3031
Divyansh Seth <59174836+sethdivyansh@users.noreply.github.com>
3132
Dominic Lim <46486515+domlimm@users.noreply.github.com>
3233
Dominik Moritz <domoritz@gmail.com>
@@ -49,6 +50,7 @@ Joey Reed <joeyrreed@gmail.com>
4950
Jordan Gallivan <115050475+Jordan-Gallivan@users.noreply.github.com>
5051
Joris Labie <joris.labie1@gmail.com>
5152
Justin Dennison <justin1dennison@gmail.com>
53+
Karan Anand <119553199+anandkaranubc@users.noreply.github.com>
5254
Karthik Prakash <116057817+skoriop@users.noreply.github.com>
5355
Kohantika Nath <145763549+kohantikanath@users.noreply.github.com>
5456
Krishnendu Das <86651039+itskdhere@users.noreply.github.com>
@@ -117,7 +119,7 @@ UtkershBasnet <119008923+UtkershBasnet@users.noreply.github.com>
117119
Vaibhav Patel <98279986+noobCoderVP@users.noreply.github.com>
118120
Varad Gupta <varadgupta21@gmail.com>
119121
Vinit Pandit <106718914+MeastroZI@users.noreply.github.com>
120-
Vivek maurya <155618190+vivekmaurya001@users.noreply.github.com>
122+
Vivek Maurya <vm8118134@gmail.com>
121123
Xiaochuan Ye <tap91624@gmail.com>
122124
Yaswanth Kosuru <116426380+yaswanthkosuru@users.noreply.github.com>
123125
Yernar Yergaziyev <yernar.yergaziyev@erg.kz>

NOTICE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Copyright (c) 2016-2024 The Stdlib Authors.
1+
Copyright (c) 2016-2025 The Stdlib Authors.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ See [LICENSE][stdlib-license].
160160

161161
## Copyright
162162

163-
Copyright &copy; 2016-2024. The Stdlib [Authors][stdlib-authors].
163+
Copyright &copy; 2016-2025. The Stdlib [Authors][stdlib-authors].
164164

165165
</section>
166166

float64/base/mul/README.md

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

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

63123
<!-- /.usage -->
@@ -224,6 +284,8 @@ int main( void ) {
224284

225285
<section class="links">
226286

287+
[@stdlib/complex/float64/ctor]: https://github.com/stdlib-js/complex/tree/main/float64/ctor
288+
227289
<!-- <related-links> -->
228290

229291
[@stdlib/complex/float64/base/add]: https://github.com/stdlib-js/complex/tree/main/float64/base/add
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 isnan = require( '@stdlib/math/base/assert/is-nan' );
26+
var Float64Array = require( '@stdlib/array/float64' );
27+
var pkg = require( './../package.json' ).name;
28+
var mul = require( './../lib' );
29+
30+
31+
// VARIABLES //
32+
33+
var options = {
34+
'dtype': 'float64'
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 10000 , options );
52+
53+
out = new Float64Array( 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 ( isnan( out[ 0 ] ) || isnan( 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 isnan = require( '@stdlib/math/base/assert/is-nan' );
26+
var Float64Array = require( '@stdlib/array/float64' );
27+
var pkg = require( './../package.json' ).name;
28+
var mul = require( './../lib' );
29+
30+
31+
// VARIABLES //
32+
33+
var options = {
34+
'dtype': 'float64'
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 Float64Array( 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 ( isnan( out[ 0 ] ) || isnan( 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