Skip to content

Commit 1af8498

Browse files
committed
Merge remote-tracking branch 'upstream/develop' into ndarray-smeanli
2 parents 944300d + 8995729 commit 1af8498

File tree

620 files changed

+19759
-5483
lines changed

Some content is hidden

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

620 files changed

+19759
-5483
lines changed

.github/workflows/labeler.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ on:
2424
pull_request_target:
2525
types:
2626
- opened
27+
- closed
2728
- synchronize
2829
- reopened
2930
- edited
@@ -64,6 +65,31 @@ jobs:
6465
configuration-path: .github/labeler.yml
6566
repo-token: ${{ secrets.CHATBOT_GITHUB_TOKEN }}
6667

68+
# Add "First-time Contributor" label if PR is from a first-time contributor:
69+
- name: 'Add "First-time Contributor" label if PR is from a first-time contributor'
70+
if: ${{ github.event.action == 'opened' || github.event.action == 'reopened' }}
71+
# Pin action to full-length commit SHA
72+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
73+
with:
74+
github-token: ${{ secrets.CHATBOT_GITHUB_TOKEN }}
75+
script: |
76+
const { data: pr } = await github.rest.pulls.get({
77+
'owner': context.repo.owner,
78+
'repo': context.repo.repo,
79+
'pull_number': context.payload.pull_request.number
80+
});
81+
if ( pr.author_association === 'FIRST_TIME_CONTRIBUTOR' ) {
82+
const labels = context.payload.pull_request.labels.map( label => label.name );
83+
if ( !labels.includes( 'First-time Contributor' ) ) {
84+
await github.rest.issues.addLabels({
85+
'owner': context.repo.owner,
86+
'repo': context.repo.repo,
87+
'issue_number': context.payload.pull_request.number,
88+
'labels': [ 'First-time Contributor' ]
89+
});
90+
}
91+
}
92+
6793
# Add "Needs Review" label when PR is opened and not a draft:
6894
- name: 'Add "Needs Review" label if PR is opened and not draft'
6995
if: ${{ github.event.action == 'opened' && github.event.pull_request.draft == false }}
@@ -133,3 +159,37 @@ jobs:
133159
console.log( 'Error removing label %s: %s', label, error.message );
134160
}
135161
}
162+
163+
# Remove "First-time Contributor" label from other open PRs of same author if PR is merged:
164+
- name: 'Remove "First-time Contributor" label from other open PRs of same author if PR is merged'
165+
if: ${{ github.event.action == 'closed' && github.event.pull_request.merged == true }}
166+
# Pin action to full length commit SHA
167+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
168+
with:
169+
github-token: ${{ secrets.CHATBOT_GITHUB_TOKEN }}
170+
script: |
171+
const prAuthor = context.payload.pull_request.user.login;
172+
const { owner, repo } = context.repo;
173+
174+
// Search for all open PRs from the PR author:
175+
const query = `repo:${owner}/${repo} type:pr state:open author:${prAuthor}`;
176+
const response = await github.rest.search.issuesAndPullRequests({
177+
'q': query,
178+
'per_page': 100
179+
});
180+
181+
const pullRequests = response.data.items;
182+
for ( const pull of pullRequests ) {
183+
if ( pull.user.login === prAuthor ) {
184+
try {
185+
await github.rest.issues.removeLabel({
186+
'owner': context.repo.owner,
187+
'repo': context.repo.repo,
188+
'issue_number': pull.number,
189+
'name': 'First-time Contributor'
190+
});
191+
} catch ( error ) {
192+
console.log( 'Error removing "First-time Contributor" label from PR #%d: %s', pull.number, error.message );
193+
}
194+
}
195+
}

.github/workflows/slash_commands.yml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,7 @@ jobs:
6161
- name: 'Add initial reaction'
6262
run: |
6363
COMMENT="${{ github.event.comment.body }}"
64-
if [[ $COMMENT == "/stdlib help" || \
65-
$COMMENT == "/stdlib check-files" || \
66-
$COMMENT == "/stdlib update-copyright-years" || \
67-
$COMMENT == "/stdlib lint-autofix" || \
68-
$COMMENT == "/stdlib merge" || \
69-
$COMMENT == "/stdlib rebase"
70-
]]; then
64+
if [[ $COMMENT =~ ^/stdlib\ (help|check-files|update-copyright-years|lint-autofix|merge|rebase) ]]; then
7165
curl -X POST \
7266
-H "Accept: application/vnd.github.v3+json" \
7367
-H "Authorization: Bearer ${{ secrets.STDLIB_BOT_GITHUB_TOKEN }}" \

CONTRIBUTORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ Daniel Killenberger <[email protected]>
2727
Daniel Yu <[email protected]>
2828
Debashis Maharana <[email protected]>
2929
Desh Deepak Kant <[email protected]>
30+
3031
Dhruv Arvind Singh <[email protected]>
3132
Divyansh Seth <[email protected]>
3233
Dominic Lim <[email protected]>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
type: amend-message
3+
---
4+
refactor!: update `blas/ext/base/dapx` to follow current project conventions
5+
6+
BREAKING CHANGE:
7+
8+
- `c_dapx()` renamed to `stdlib_strided_dapx()`
9+
- `c_dapx_ndarray()` renamed to `stdlib_strided_dapx_ndarray()`
10+
11+
All downstream usage of the old `c_dapx*` symbols must be updated to use the new symbols.
12+
13+
PR-URL: https://github.com/stdlib-js/stdlib/pull/4737
14+
Reviewed-by: Philipp Burckhardt <[email protected]>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
type: amend-message
3+
---
4+
docs: update namespace TypeScript declaration comments
5+
6+
PR-URL: https://github.com/stdlib-js/stdlib/pull/4487
7+
8+
Co-authored-by: Philipp Burckhardt <[email protected]>
9+
Reviewed-by: Philipp Burckhardt <[email protected]>
10+
Signed-off-by: stdlib-bot <[email protected]>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
type: amend-message
3+
---
4+
docs: update namespace TypeScript declaration comments
5+
6+
PR-URL: https://github.com/stdlib-js/stdlib/pull/4518
7+
8+
Co-authored-by: Philipp Burckhardt <[email protected]>
9+
Reviewed-by: Philipp Burckhardt <[email protected]>
10+
Signed-off-by: stdlib-bot <[email protected]>
Lines changed: 233 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,233 @@
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+
# zdscal
22+
23+
> Scale a double-precision complex floating-point vector by a double-precision floating-point constant.
24+
25+
<section class="usage">
26+
27+
## Usage
28+
29+
```javascript
30+
var zdscal = require( '@stdlib/blas/base/zdscal' );
31+
```
32+
33+
#### zdscal( N, da, zx, strideZX )
34+
35+
Scales a double-precision complex floating-point vector by a double-precision floating-point constant.
36+
37+
```javascript
38+
var Complex128Array = require( '@stdlib/array/complex128' );
39+
var real = require( '@stdlib/complex/float64/real' );
40+
var imag = require( '@stdlib/complex/float64/imag' );
41+
42+
var zx = new Complex128Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] );
43+
44+
zdscal( 3, 2.0, zx, 1 );
45+
46+
var z = zx.get( 0 );
47+
// returns <Complex128>
48+
49+
var re = real( z );
50+
// returns 2.0
51+
52+
var im = imag( z );
53+
// returns 2.0
54+
```
55+
56+
The function has the following parameters:
57+
58+
- **N**: number of indexed elements.
59+
- **da**: scalar constant.
60+
- **zx**: input [`Complex128Array`][@stdlib/array/complex128].
61+
- **strideZX**: stride length for `zx`.
62+
63+
The `N` and stride parameters determine which elements in `zx` are scaled by `da`. For example, to scale every other element in `zx` by `da`,
64+
65+
```javascript
66+
var Complex128Array = require( '@stdlib/array/complex128' );
67+
var real = require( '@stdlib/complex/float64/real' );
68+
var imag = require( '@stdlib/complex/float64/imag' );
69+
70+
var zx = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );
71+
72+
zdscal( 2, 2.0, zx, 2 );
73+
74+
var z = zx.get( 2 );
75+
// returns <Complex128>
76+
77+
var re = real( z );
78+
// returns 10.0
79+
80+
var im = imag( z );
81+
// returns 12.0
82+
```
83+
84+
Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views.
85+
86+
<!-- eslint-disable stdlib/capitalized-comments -->
87+
88+
```javascript
89+
var Complex128Array = require( '@stdlib/array/complex128' );
90+
var real = require( '@stdlib/complex/float64/real' );
91+
var imag = require( '@stdlib/complex/float64/imag' );
92+
93+
// Initial array:
94+
var zx0 = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );
95+
96+
// Create an offset view:
97+
var zx1 = new Complex128Array( zx0.buffer, zx0.BYTES_PER_ELEMENT*1 ); // start at 2nd element
98+
99+
// Scale every element in `zx1`:
100+
zdscal( 3, 2.0, zx1, 1 );
101+
102+
var z = zx0.get( 0 );
103+
// returns <Complex128>
104+
105+
var re = real( z );
106+
// returns 1.0
107+
108+
var im = imag( z );
109+
// returns 2.0
110+
111+
z = zx0.get( 1 );
112+
// returns <Complex128>
113+
114+
re = real( z );
115+
// returns 6.0
116+
117+
im = imag( z );
118+
// returns 8.0
119+
```
120+
121+
#### zdscal.ndarray( N, da, zx, strideZX, offsetZX )
122+
123+
Scales a double-precision complex floating-point vector by a double-precision floating-point constant using alternative indexing semantics.
124+
125+
```javascript
126+
var Complex128Array = require( '@stdlib/array/complex128' );
127+
var real = require( '@stdlib/complex/float64/real' );
128+
var imag = require( '@stdlib/complex/float64/imag' );
129+
130+
var zx = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
131+
132+
zdscal.ndarray( 3, 2.0, zx, 1, 0 );
133+
134+
var z = zx.get( 0 );
135+
// returns <Complex128>
136+
137+
var re = real( z );
138+
// returns 2.0
139+
140+
var im = imag( z );
141+
// returns 4.0
142+
```
143+
144+
The function has the following additional parameters:
145+
146+
- **offsetZX**: starting index for `zx`.
147+
148+
While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameter supports indexing semantics based on a starting index. For example, to scale every other element in the input strided array starting from the second element,
149+
150+
```javascript
151+
var Complex128Array = require( '@stdlib/array/complex128' );
152+
var real = require( '@stdlib/complex/float64/real' );
153+
var imag = require( '@stdlib/complex/float64/imag' );
154+
155+
var zx = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );
156+
157+
zdscal.ndarray( 2, 2.0, zx, 2, 1 );
158+
159+
var z = zx.get( 3 );
160+
// returns <Complex128>
161+
162+
var re = real( z );
163+
// returns 14.0
164+
165+
var im = imag( z );
166+
// returns 16.0
167+
```
168+
169+
</section>
170+
171+
<!-- /.usage -->
172+
173+
<section class="notes">
174+
175+
## Notes
176+
177+
- If `N <= 0`, both functions return `zx` unchanged.
178+
- `zdscal()` corresponds to the [BLAS][blas] level 1 function [`zdscal`][zdscal].
179+
180+
</section>
181+
182+
<!-- /.notes -->
183+
184+
<section class="examples">
185+
186+
## Examples
187+
188+
<!-- eslint no-undef: "error" -->
189+
190+
```javascript
191+
var discreteUniform = require( '@stdlib/random/base/discrete-uniform' );
192+
var filledarrayBy = require( '@stdlib/array/filled-by' );
193+
var Complex128 = require( '@stdlib/complex/float64/ctor' );
194+
var zdscal = require( '@stdlib/blas/base/zdscal' );
195+
196+
function rand() {
197+
return new Complex128( discreteUniform( 0, 10 ), discreteUniform( -5, 5 ) );
198+
}
199+
200+
var zx = filledarrayBy( 10, 'complex128', rand );
201+
console.log( zx.toString() );
202+
203+
zdscal( zx.length, 2.0, zx, 1 );
204+
console.log( zx.toString() );
205+
```
206+
207+
</section>
208+
209+
<!-- /.examples -->
210+
211+
<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->
212+
213+
<section class="related">
214+
215+
</section>
216+
217+
<!-- /.related -->
218+
219+
<!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
220+
221+
<section class="links">
222+
223+
[blas]: http://www.netlib.org/blas
224+
225+
[zdscal]: https://www.netlib.org/lapack/explore-html/d2/de8/group__scal_ga40d50a435a5fcf16cf41fa80d746819f.html#ga40d50a435a5fcf16cf41fa80d746819f
226+
227+
[mdn-typed-array]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray
228+
229+
[@stdlib/array/complex128]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/complex128
230+
231+
</section>
232+
233+
<!-- /.links -->

0 commit comments

Comments
 (0)