Skip to content

Commit e39704d

Browse files
committed
Auto-generated commit
1 parent 61f18b1 commit e39704d

59 files changed

Lines changed: 16012 additions & 17 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎CHANGELOG.md‎

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,22 @@
44

55
<section class="release" id="unreleased">
66

7-
## Unreleased (2026-06-25)
7+
## Unreleased (2026-06-26)
88

99
<section class="features">
1010

1111
### Features
1212

13+
- [`2e56dfa`](https://github.com/stdlib-js/stdlib/commit/2e56dfa5c8f48ea64c01692be8cc4ef5a7999d1e) - add `Int32Matrix` to namespace
14+
- [`03d3cb0`](https://github.com/stdlib-js/stdlib/commit/03d3cb0a816d66f3f6030b2264f839936877ab57) - add `ndarray/matrix/int32`
15+
- [`f5beb7b`](https://github.com/stdlib-js/stdlib/commit/f5beb7b7fcecce5c85c4f731e4df9eceb7c98578) - add `Complex64Matrix` to namespace
16+
- [`117fe75`](https://github.com/stdlib-js/stdlib/commit/117fe751816caf42111d31fa39b9fe2503ad6665) - add `ndarray/matrix/complex64`
17+
- [`938cdf3`](https://github.com/stdlib-js/stdlib/commit/938cdf3e67b39a60c4dbac0b59f4100489abbe74) - add `Complex128Matrix` to namespace
18+
- [`6e71938`](https://github.com/stdlib-js/stdlib/commit/6e719388f340e1b01f4831cc2d64d1d662ad32df) - add `ndarray/matrix/complex128`
19+
- [`f4b524c`](https://github.com/stdlib-js/stdlib/commit/f4b524c3b7329c10f3623aa534bbc36434342620) - add `Float32Matrix` to namespace
20+
- [`d93e3df`](https://github.com/stdlib-js/stdlib/commit/d93e3df2ee39745a4af0f9c7341c77446b43f220) - add `ndarray/matrix/float32`
21+
- [`31016c4`](https://github.com/stdlib-js/stdlib/commit/31016c40769d96ea8d60dc03967378373f12b997) - add `Float64Matrix` to namespace
22+
- [`af1484d`](https://github.com/stdlib-js/stdlib/commit/af1484d610d52886bd70176a603945b734480f7d) - add `ndarray/matrix/float64`
1323
- [`9e91810`](https://github.com/stdlib-js/stdlib/commit/9e91810bfa37f32b66e04ac1ee69b640ea2e43ff) - update `ndarray/base/assert` TypeScript declarations [(#13119)](https://github.com/stdlib-js/stdlib/pull/13119)
1424
- [`8bf9161`](https://github.com/stdlib-js/stdlib/commit/8bf91614301abf9249ff3ea9379baa4bc6c450e0) - add `ndarray/matrix` namespace
1525
- [`dc9a2a7`](https://github.com/stdlib-js/stdlib/commit/dc9a2a7eb4962f9743ba7a7369a6593669370296) - add `ndarray/matrix/ctor`
@@ -51,6 +61,20 @@
5161

5262
<details>
5363

64+
- [`7ff0456`](https://github.com/stdlib-js/stdlib/commit/7ff0456ac62f36e058b8f25bd3628750ab3daf7f) - **docs:** document accepted arguments _(by Athan Reines)_
65+
- [`56ffe96`](https://github.com/stdlib-js/stdlib/commit/56ffe96cd1f83bb3e66cc0c2b63eba05fd2d5ee9) - **docs:** document accepted arguments _(by Athan Reines)_
66+
- [`2e56dfa`](https://github.com/stdlib-js/stdlib/commit/2e56dfa5c8f48ea64c01692be8cc4ef5a7999d1e) - **feat:** add `Int32Matrix` to namespace _(by Athan Reines)_
67+
- [`03d3cb0`](https://github.com/stdlib-js/stdlib/commit/03d3cb0a816d66f3f6030b2264f839936877ab57) - **feat:** add `ndarray/matrix/int32` _(by Athan Reines)_
68+
- [`f5beb7b`](https://github.com/stdlib-js/stdlib/commit/f5beb7b7fcecce5c85c4f731e4df9eceb7c98578) - **feat:** add `Complex64Matrix` to namespace _(by Athan Reines)_
69+
- [`117fe75`](https://github.com/stdlib-js/stdlib/commit/117fe751816caf42111d31fa39b9fe2503ad6665) - **feat:** add `ndarray/matrix/complex64` _(by Athan Reines)_
70+
- [`938cdf3`](https://github.com/stdlib-js/stdlib/commit/938cdf3e67b39a60c4dbac0b59f4100489abbe74) - **feat:** add `Complex128Matrix` to namespace _(by Athan Reines)_
71+
- [`6e71938`](https://github.com/stdlib-js/stdlib/commit/6e719388f340e1b01f4831cc2d64d1d662ad32df) - **feat:** add `ndarray/matrix/complex128` _(by Athan Reines)_
72+
- [`f4b524c`](https://github.com/stdlib-js/stdlib/commit/f4b524c3b7329c10f3623aa534bbc36434342620) - **feat:** add `Float32Matrix` to namespace _(by Athan Reines)_
73+
- [`d26b827`](https://github.com/stdlib-js/stdlib/commit/d26b827c5b7d33b251406c853081eef1a43a3a26) - **docs:** update descriptions _(by Athan Reines)_
74+
- [`d93e3df`](https://github.com/stdlib-js/stdlib/commit/d93e3df2ee39745a4af0f9c7341c77446b43f220) - **feat:** add `ndarray/matrix/float32` _(by Athan Reines)_
75+
- [`31016c4`](https://github.com/stdlib-js/stdlib/commit/31016c40769d96ea8d60dc03967378373f12b997) - **feat:** add `Float64Matrix` to namespace _(by Athan Reines)_
76+
- [`af1484d`](https://github.com/stdlib-js/stdlib/commit/af1484d610d52886bd70176a603945b734480f7d) - **feat:** add `ndarray/matrix/float64` _(by Athan Reines)_
77+
- [`206c0f4`](https://github.com/stdlib-js/stdlib/commit/206c0f4cec52a225c042b7788aa97c4e631d09a3) - **docs:** update descriptions _(by Athan Reines)_
5478
- [`ae0704c`](https://github.com/stdlib-js/stdlib/commit/ae0704c8acf3023469ab02686154e26193a601cd) - **docs:** fix typo `PREMABLE` to `PREAMBLE` [(#13130)](https://github.com/stdlib-js/stdlib/pull/13130) _(by anee3)_
5579
- [`3adbe8a`](https://github.com/stdlib-js/stdlib/commit/3adbe8a17ba4a8ac59a6dbb66085ee84cb78d35d) - **docs:** propagate fixes to sibling packages [(#13133)](https://github.com/stdlib-js/stdlib/pull/13133) _(by Philipp Burckhardt)_
5680
- [`92b5eb4`](https://github.com/stdlib-js/stdlib/commit/92b5eb479a9ba6d3fe4f722d2f1b47e61a03122c) - **fix:** use correct argument during error message interpolation and update descriptions [(#13105)](https://github.com/stdlib-js/stdlib/pull/13105) _(by Philipp Burckhardt)_

‎matrix/complex128/README.md‎

Lines changed: 280 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,280 @@
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+
# Complex128Matrix
22+
23+
> Create a double-precision complex floating-point matrix (i.e., a two-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 Complex128Matrix = require( '@stdlib/ndarray/matrix/complex128' );
41+
```
42+
43+
#### Complex128Matrix( \[options] )
44+
45+
Returns a two-dimensional double-precision complex floating-point [ndarray][@stdlib/ndarray/ctor].
46+
47+
```javascript
48+
var getShape = require( '@stdlib/ndarray/shape' );
49+
50+
var arr = new Complex128Matrix();
51+
// returns <ndarray>
52+
53+
var len = getShape( arr );
54+
// returns [ 0, 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+
- **submode**: a mode array which specifies for each dimension how to handle subscripts which exceed array dimensions (see [`ndarray`][@stdlib/ndarray/ctor]). If provided fewer modes than dimensions, an [`ndarray`][@stdlib/ndarray/ctor]) instance recycles modes using modulo arithmetic. Default: `[ options.mode ]`.
62+
- **readonly**: boolean indicating whether an array should be **read-only**. Default: `false`.
63+
64+
#### Complex128Matrix( shape\[, options] )
65+
66+
Returns a two-dimensional double-precision complex floating-point [ndarray][@stdlib/ndarray/ctor] having a specified shape.
67+
68+
```javascript
69+
var getShape = require( '@stdlib/ndarray/shape' );
70+
71+
var arr = new Complex128Matrix( [ 3, 3 ] );
72+
// returns <ndarray>
73+
74+
var sh = getShape( arr );
75+
// returns [ 3, 3 ]
76+
```
77+
78+
The function accepts the following arguments:
79+
80+
- **shape**: array shape. Must contain exactly two elements.
81+
- **options**: function options. See above.
82+
83+
#### Complex128Matrix( M, N\[, options] )
84+
85+
Returns a two-dimensional double-precision complex floating-point [ndarray][@stdlib/ndarray/ctor] having a specified shape.
86+
87+
```javascript
88+
var getShape = require( '@stdlib/ndarray/shape' );
89+
90+
var arr = new Complex128Matrix( 3, 3 );
91+
// returns <ndarray>
92+
93+
var sh = getShape( arr );
94+
// returns [ 3, 3 ]
95+
```
96+
97+
The function accepts the following arguments:
98+
99+
- **M**: number of rows.
100+
- **N**: number of columns.
101+
- **options**: function options. See above.
102+
103+
#### Complex128Matrix( obj\[, options] )
104+
105+
Creates a two-dimensional double-precision complex floating-point [ndarray][@stdlib/ndarray/ctor] from an array-like object or iterable.
106+
107+
<!-- eslint-disable max-len -->
108+
109+
```javascript
110+
var getShape = require( '@stdlib/ndarray/shape' );
111+
112+
var arr = new Complex128Matrix( [ [ 1.0, 2.0, 3.0, 4.0 ], [ 5.0, 6.0, 7.0, 8.0 ] ] );
113+
// returns <ndarray>
114+
115+
var sh = getShape( arr );
116+
// returns [ 2, 2 ]
117+
```
118+
119+
The function accepts the following arguments:
120+
121+
- **obj**: array-like object or iterable from which to generate an [ndarray][@stdlib/ndarray/ctor]. If an array-like object, the value must be a nested array (i.e., an array-like object of array-like objects), where each nested array must have the same number of elements. If an iterable, the iterable must return array- like objects, each of which must have the same number of elements.
122+
- **options**: function options. See above.
123+
124+
#### Complex128Matrix( buffer\[, byteOffset\[, shape]]\[, options] )
125+
126+
Returns a two-dimensional double-precision complex floating-point [ndarray][@stdlib/ndarray/ctor] view of an [`ArrayBuffer`][@stdlib/array/buffer].
127+
128+
```javascript
129+
var ArrayBuffer = require( '@stdlib/array/buffer' );
130+
var getShape = require( '@stdlib/ndarray/shape' );
131+
132+
var buf = new ArrayBuffer( 64 );
133+
134+
var arr1 = new Complex128Matrix( buf );
135+
// returns <ndarray>
136+
137+
var sh1 = getShape( arr1 );
138+
// returns [ 1, 4 ]
139+
140+
var arr2 = new Complex128Matrix( buf, 16 );
141+
// returns <ndarray>
142+
143+
var sh2 = getShape( arr2 );
144+
// returns [ 1, 3 ]
145+
146+
var arr3 = new Complex128Matrix( buf, 16, [ 2, 1 ] );
147+
// returns <ndarray>
148+
149+
var sh3 = getShape( arr3 );
150+
// returns [ 2, 1 ]
151+
```
152+
153+
The function accepts the following arguments:
154+
155+
- **buffer**: underlying [`ArrayBuffer`][@stdlib/array/buffer].
156+
- **byteOffset**: integer byte offset specifying the location of the first indexed element. Default: `0`.
157+
- **shape**: array shape. Must contain exactly two elements.
158+
- **options**: function options. See above.
159+
160+
#### Complex128Matrix( buffer\[, byteOffset\[, M, N]]\[, options] )
161+
162+
Returns a two-dimensional double-precision complex floating-point [ndarray][@stdlib/ndarray/ctor] view of an [`ArrayBuffer`][@stdlib/array/buffer].
163+
164+
```javascript
165+
var ArrayBuffer = require( '@stdlib/array/buffer' );
166+
var getShape = require( '@stdlib/ndarray/shape' );
167+
168+
var buf = new ArrayBuffer( 64 );
169+
170+
var arr = new Complex128Matrix( buf, 16, 2, 1 );
171+
// returns <ndarray>
172+
173+
var sh = getShape( arr );
174+
// returns [ 2, 1 ]
175+
```
176+
177+
The function accepts the following arguments:
178+
179+
- **buffer**: underlying [`ArrayBuffer`][@stdlib/array/buffer].
180+
- **byteOffset**: integer byte offset specifying the location of the first indexed element. Default: `0`.
181+
- **M**: number of rows.
182+
- **N**: number of columns.
183+
- **options**: function options. See above.
184+
185+
</section>
186+
187+
<!-- /.usage -->
188+
189+
<!-- Package usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
190+
191+
<section class="notes">
192+
193+
## Notes
194+
195+
- Nested arrays are flattened in lexicographic order, such that, for an input nested array `obj`, `obj[i][j]` corresponds to the element `mat.get(i, j)` in the returned two-dimensional ndarray. In other words, an input nested array is assumed to be comprised of rows. Similarly, if `obj` is an iterable, each array returned by the iterable is assumed to correspond to a matrix row.
196+
- If provided an `ArrayBuffer` without corresponding shape arguments, the leading dimension of the returned ndarray always has a size of one.
197+
198+
</section>
199+
200+
<!-- /.notes -->
201+
202+
<!-- Package usage examples. -->
203+
204+
<section class="examples">
205+
206+
## Examples
207+
208+
<!-- eslint no-undef: "error" -->
209+
210+
```javascript
211+
var discreteUniform = require( '@stdlib/random/array/discrete-uniform' );
212+
var sum = require( '@stdlib/blas/ext/sum' );
213+
var map = require( '@stdlib/ndarray/map' );
214+
var real = require( '@stdlib/complex/float64/real' );
215+
var imag = require( '@stdlib/complex/float64/imag' );
216+
var Complex128 = require( '@stdlib/complex/float64/ctor' );
217+
var ndarray2array = require( '@stdlib/ndarray/to-array' );
218+
var Complex128Matrix = require( '@stdlib/ndarray/matrix/complex128' );
219+
220+
// Create a matrix containing random values:
221+
var x = new Complex128Matrix([
222+
discreteUniform( 20, 0, 100 ),
223+
discreteUniform( 20, 0, 20 )
224+
]);
225+
226+
// Compute the sum along the columns:
227+
var v = sum( x, {
228+
'dims': [ -1 ]
229+
});
230+
console.log( ndarray2array( v ) );
231+
232+
// Define a function which applies a threshold to individual values:
233+
function threshold( v ) {
234+
if ( real( v ) > 10 && imag( v ) > 10 ) {
235+
return v;
236+
}
237+
return new Complex128( 0.0, 0.0 );
238+
}
239+
240+
// Apply threshold:
241+
var y = map( x, threshold );
242+
243+
// Recompute the sum along the columns:
244+
v = sum( y, {
245+
'dims': [ -1 ]
246+
});
247+
console.log( ndarray2array( v ) );
248+
```
249+
250+
</section>
251+
252+
<!-- /.examples -->
253+
254+
<!-- 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. -->
255+
256+
<section class="references">
257+
258+
</section>
259+
260+
<!-- /.references -->
261+
262+
<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->
263+
264+
<section class="related">
265+
266+
</section>
267+
268+
<!-- /.related -->
269+
270+
<!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
271+
272+
<section class="links">
273+
274+
[@stdlib/array/buffer]: https://github.com/stdlib-js/array-buffer
275+
276+
[@stdlib/ndarray/ctor]: https://github.com/stdlib-js/ndarray/tree/main/ctor
277+
278+
</section>
279+
280+
<!-- /.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) 2026 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 Complex128Matrix = 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 Complex128Matrix( 0, 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)