Skip to content

Commit 92cbdb5

Browse files
committed
Auto-generated commit
1 parent 40e7df7 commit 92cbdb5

File tree

26 files changed

+4683
-1
lines changed

26 files changed

+4683
-1
lines changed

CHANGELOG.md

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

7-
## Unreleased (2025-05-21)
7+
## Unreleased (2025-05-27)
88

99
<section class="features">
1010

1111
### Features
1212

13+
- [`138cc36`](https://github.com/stdlib-js/stdlib/commit/138cc36c180a676fc4ae8b675d77d58db8f02f26) - add `Complex64Vector` to namespace
14+
- [`50dac78`](https://github.com/stdlib-js/stdlib/commit/50dac7824c40e9cf5c10b0ee576f44fba8b191a5) - add `ndarray/vector/complex64`
15+
- [`0431d21`](https://github.com/stdlib-js/stdlib/commit/0431d211467c0ebfa57547a5da66f598870bbf33) - add `Complex128Vector` to namespace
16+
- [`0183f29`](https://github.com/stdlib-js/stdlib/commit/0183f293bf9a127899492ad80a87394e8b18afc1) - add `ndarray/vector/complex128`
1317
- [`5149a37`](https://github.com/stdlib-js/stdlib/commit/5149a3789bf321b18b1636b838ab086175b6c2ca) - add `ndarray/base/unary-reduce-subarray-by` [(#7008)](https://github.com/stdlib-js/stdlib/pull/7008)
1418
- [`54dc71e`](https://github.com/stdlib-js/stdlib/commit/54dc71e0ff4a2b5661d48a1bdee584507f66373f) - add `every` and `includes` to namespace
1519
- [`2349a6e`](https://github.com/stdlib-js/stdlib/commit/2349a6edf849f8f7093a77bbdeb2fdd7d9955f89) - add `vector` to namespace
@@ -407,6 +411,11 @@ A total of 15 issues were closed in this release:
407411

408412
<details>
409413

414+
- [`34f6c88`](https://github.com/stdlib-js/stdlib/commit/34f6c88797418bf412b222450bd1659e43b7a7c1) - **docs:** update namespace table of contents [(#7105)](https://github.com/stdlib-js/stdlib/pull/7105) _(by stdlib-bot)_
415+
- [`138cc36`](https://github.com/stdlib-js/stdlib/commit/138cc36c180a676fc4ae8b675d77d58db8f02f26) - **feat:** add `Complex64Vector` to namespace _(by Athan Reines)_
416+
- [`50dac78`](https://github.com/stdlib-js/stdlib/commit/50dac7824c40e9cf5c10b0ee576f44fba8b191a5) - **feat:** add `ndarray/vector/complex64` _(by Athan Reines)_
417+
- [`0431d21`](https://github.com/stdlib-js/stdlib/commit/0431d211467c0ebfa57547a5da66f598870bbf33) - **feat:** add `Complex128Vector` to namespace _(by Athan Reines)_
418+
- [`0183f29`](https://github.com/stdlib-js/stdlib/commit/0183f293bf9a127899492ad80a87394e8b18afc1) - **feat:** add `ndarray/vector/complex128` _(by Athan Reines)_
410419
- [`cc20b2d`](https://github.com/stdlib-js/stdlib/commit/cc20b2de446f10e06216b84bdd5457ef473ffdd6) - **refactor:** update require path _(by Athan Reines)_
411420
- [`5149a37`](https://github.com/stdlib-js/stdlib/commit/5149a3789bf321b18b1636b838ab086175b6c2ca) - **feat:** add `ndarray/base/unary-reduce-subarray-by` [(#7008)](https://github.com/stdlib-js/stdlib/pull/7008) _(by Muhammad Haris, Athan Reines)_
412421
- [`89d9dc3`](https://github.com/stdlib-js/stdlib/commit/89d9dc316985aa3c194222afbf8146e58ff6d761) - **docs:** update namespace table of contents [(#7046)](https://github.com/stdlib-js/stdlib/pull/7046) _(by stdlib-bot)_

CONTRIBUTORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ Spandan Barve <[email protected]>
167167
Stephannie Jiménez Gacha <[email protected]>
168168
Suhaib Ilahi <[email protected]>
169169
Suraj Kumar <[email protected]>
170+
Swapnil Hajare <[email protected]>
170171
Tanishq Ahuja <[email protected]>
171172
Tirtadwipa Manunggal <[email protected]>
172173
Tudor Pagu <[email protected]>

vector/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ The namespace exports the following:
5656
<div class="namespace-toc">
5757

5858
- <span class="signature">[`BooleanVector()`][@stdlib/ndarray/vector/bool]</span><span class="delimiter">: </span><span class="description">create a boolean vector (i.e., a one-dimensional ndarray).</span>
59+
- <span class="signature">[`Complex128Vector()`][@stdlib/ndarray/vector/complex128]</span><span class="delimiter">: </span><span class="description">create a double-precision complex floating-point vector (i.e., a one-dimensional ndarray).</span>
60+
- <span class="signature">[`Complex64Vector()`][@stdlib/ndarray/vector/complex64]</span><span class="delimiter">: </span><span class="description">create a single-precision complex floating-point vector (i.e., a one-dimensional ndarray).</span>
5961
- <span class="signature">[`vector()`][@stdlib/ndarray/vector/ctor]</span><span class="delimiter">: </span><span class="description">create a vector (i.e., a one-dimensional ndarray).</span>
6062
- <span class="signature">[`Float32Vector()`][@stdlib/ndarray/vector/float32]</span><span class="delimiter">: </span><span class="description">create a single-precision floating-point vector (i.e., a one-dimensional ndarray).</span>
6163
- <span class="signature">[`Float64Vector()`][@stdlib/ndarray/vector/float64]</span><span class="delimiter">: </span><span class="description">create a double-precision floating-point vector (i.e., a one-dimensional ndarray).</span>
@@ -120,6 +122,10 @@ console.log( objectKeys( ns ) );
120122

121123
[@stdlib/ndarray/vector/bool]: https://github.com/stdlib-js/ndarray/tree/main/vector/bool
122124

125+
[@stdlib/ndarray/vector/complex128]: https://github.com/stdlib-js/ndarray/tree/main/vector/complex128
126+
127+
[@stdlib/ndarray/vector/complex64]: https://github.com/stdlib-js/ndarray/tree/main/vector/complex64
128+
123129
[@stdlib/ndarray/vector/ctor]: https://github.com/stdlib-js/ndarray/tree/main/vector/ctor
124130

125131
[@stdlib/ndarray/vector/float32]: https://github.com/stdlib-js/ndarray/tree/main/vector/float32

vector/complex128/README.md

Lines changed: 202 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,202 @@
1+
<!--
2+
3+
@license Apache-2.0
4+
5+
Copyright (c) 2025 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+
# Complex128Vector
22+
23+
> Create a double-precision complex floating-point vector (i.e., a one-dimensional [ndarray][@stdlib/ndarray/ctor]).
24+
25+
<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->
26+
27+
<section class="intro">
28+
29+
</section>
30+
31+
<!-- /.intro -->
32+
33+
<!-- Package usage documentation. -->
34+
35+
<section class="usage">
36+
37+
## Usage
38+
39+
```javascript
40+
var Complex128Vector = require( '@stdlib/ndarray/vector/complex128' );
41+
```
42+
43+
#### Complex128Vector( \[options] )
44+
45+
Returns a one-dimensional double-precision complex floating-point [ndarray][@stdlib/ndarray/ctor].
46+
47+
```javascript
48+
var numel = require( '@stdlib/ndarray/numel' );
49+
50+
var arr = new Complex128Vector();
51+
// returns <ndarray>
52+
53+
var len = numel( arr );
54+
// returns 0
55+
```
56+
57+
The function accepts the following options:
58+
59+
- **order**: specifies whether an [ndarray][@stdlib/ndarray/ctor] is `'row-major'` (C-style) or `'column-major'` (Fortran-style). Default: `'row-major'`.
60+
- **mode**: specifies how to handle indices which exceed array dimensions (see [`ndarray`][@stdlib/ndarray/ctor]). Default: `'throw'`.
61+
- **readonly**: boolean indicating whether an array should be **read-only**. Default: `false`.
62+
63+
#### Complex128Vector( length\[, options] )
64+
65+
Returns a one-dimensional double-precision complex floating-point [ndarray][@stdlib/ndarray/ctor] having a specified `length`.
66+
67+
```javascript
68+
var numel = require( '@stdlib/ndarray/numel' );
69+
70+
var arr = new Complex128Vector( 5 );
71+
// returns <ndarray>
72+
73+
var len1 = numel( arr );
74+
// returns 5
75+
```
76+
77+
#### Complex128Vector( obj\[, options] )
78+
79+
Creates a one-dimensional double-precision complex floating-point [ndarray][@stdlib/ndarray/ctor] from an array-like object or iterable.
80+
81+
```javascript
82+
var numel = require( '@stdlib/ndarray/numel' );
83+
84+
var arr = new Complex128Vector( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
85+
// returns <ndarray>
86+
87+
var len1 = numel( arr );
88+
// returns 3
89+
```
90+
91+
#### Complex128Vector( buffer\[, byteOffset\[, length]]\[, options] )
92+
93+
Returns a one-dimensional double-precision complex floating-point [ndarray][@stdlib/ndarray/ctor] view of an [`ArrayBuffer`][@stdlib/array/buffer].
94+
95+
```javascript
96+
var ArrayBuffer = require( '@stdlib/array/buffer' );
97+
var numel = require( '@stdlib/ndarray/numel' );
98+
99+
var buf = new ArrayBuffer( 64 );
100+
101+
var arr1 = new Complex128Vector( buf );
102+
// returns <ndarray>
103+
104+
var len1 = numel( arr1 );
105+
// returns 4
106+
107+
var arr2 = new Complex128Vector( buf, 16 );
108+
// returns <ndarray>
109+
110+
var len2 = numel( arr2 );
111+
// returns 3
112+
113+
var arr3 = new Complex128Vector( buf, 16, 1 );
114+
// returns <ndarray>
115+
116+
var len3 = numel( arr3 );
117+
// returns 1
118+
```
119+
120+
</section>
121+
122+
<!-- /.usage -->
123+
124+
<!-- Package usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
125+
126+
<section class="notes">
127+
128+
</section>
129+
130+
<!-- /.notes -->
131+
132+
<!-- Package usage examples. -->
133+
134+
<section class="examples">
135+
136+
## Examples
137+
138+
<!-- eslint no-undef: "error" -->
139+
140+
```javascript
141+
var discreteUniform = require( '@stdlib/random/array/discrete-uniform' );
142+
var sum = require( '@stdlib/blas/ext/sum' );
143+
var map = require( '@stdlib/ndarray/map' );
144+
var real = require( '@stdlib/complex/float64/real' );
145+
var imag = require( '@stdlib/complex/float64/imag' );
146+
var Complex128 = require( '@stdlib/complex/float64/ctor' );
147+
var Complex128Vector = require( '@stdlib/ndarray/vector/complex128' );
148+
149+
// Create a vector containing random values:
150+
var x = new Complex128Vector( discreteUniform( 20, 0, 100 ) );
151+
152+
// Compute the sum:
153+
var v = sum( x );
154+
console.log( v.get() );
155+
156+
// Define a function which applies a threshold to real and imaginary components:
157+
function threshold( v ) {
158+
if ( real( v ) > 10 && imag( v ) > 10 ) {
159+
return v;
160+
}
161+
return new Complex128( 0.0, 0.0 );
162+
}
163+
164+
// Apply threshold:
165+
var y = map( x, threshold );
166+
167+
// Recompute the sum:
168+
v = sum( y );
169+
console.log( v.get() );
170+
```
171+
172+
</section>
173+
174+
<!-- /.examples -->
175+
176+
<!-- Section to include cited references. If references are included, add a horizontal rule *before* the section. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
177+
178+
<section class="references">
179+
180+
</section>
181+
182+
<!-- /.references -->
183+
184+
<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->
185+
186+
<section class="related">
187+
188+
</section>
189+
190+
<!-- /.related -->
191+
192+
<!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
193+
194+
<section class="links">
195+
196+
[@stdlib/array/buffer]: https://github.com/stdlib-js/array-buffer
197+
198+
[@stdlib/ndarray/ctor]: https://github.com/stdlib-js/ndarray/tree/main/ctor
199+
200+
</section>
201+
202+
<!-- /.links -->
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
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 isndarrayLike = require( '@stdlib/assert/is-ndarray-like' );
25+
var pkg = require( './../package.json' ).name;
26+
var Complex128Vector = require( './../lib' );
27+
28+
29+
// MAIN //
30+
31+
bench( pkg, function benchmark( b ) {
32+
var arr;
33+
var i;
34+
b.tic();
35+
for ( i = 0; i < b.iterations; i++ ) {
36+
arr = new Complex128Vector( 0 );
37+
if ( arr.length !== 0 ) {
38+
b.fail( 'should have length 0' );
39+
}
40+
}
41+
b.toc();
42+
if ( !isndarrayLike( arr ) ) {
43+
b.fail( 'should return an ndarray' );
44+
}
45+
b.pass( 'benchmark finished' );
46+
b.end();
47+
});

0 commit comments

Comments
 (0)