Skip to content

Commit 33e8edb

Browse files
committed
Merge branch 'develop' of https://github.com/stdlib-js/stdlib into develop
2 parents d31e751 + 7b40b6d commit 33e8edb

File tree

37 files changed

+3091
-29
lines changed

37 files changed

+3091
-29
lines changed

.npmrc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,5 @@ shrinkwrap = false
2727
# Disable automatically "saving" dependencies on install:
2828
save = false
2929

30-
# Generate provenance metadata:
31-
provenance = true
30+
# Do not generate provenance metadata:
31+
provenance = false

lib/node_modules/@stdlib/_tools/changelog/generate/lib/format_contributors.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,11 @@ function formatContributor( contributor ) {
100100
*/
101101
function formatContributors( commits ) {
102102
var contributors = extractContributors( commits );
103-
var out = sectionStart( 'contributors' );
103+
var out;
104+
if ( contributors.length === 0 ) {
105+
return '';
106+
}
107+
out = sectionStart( 'contributors' );
104108
out += heading( 'Contributors', 3 );
105109
if ( contributors.length === 1 ) {
106110
out += 'A total of 1 person contributed to this release. Thank you to this contributor:\n\n';

lib/node_modules/@stdlib/_tools/changelog/parse-commits/lib/conventional_changelog.js

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,16 @@
2222

2323
var visitWithAncestors = require( 'unist-util-visit-parents' );
2424
var visit = require( 'unist-util-visit' );
25+
var contains = require( '@stdlib/assert/contains' );
26+
var replace = require( '@stdlib/string/base/replace' );
2527

2628

2729
// VARIABLES //
2830

2931
var RE_DIGITS = /^[0-9]+$/;
3032
var RE_CLOSES = /(?:closes|fixes|resolves)/i;
3133
var RE_CO_AUTHORED_BY = /co-authored-by/i;
34+
var RE_LEADING_HASH = /^\s*#/;
3235

3336

3437
// MAIN //
@@ -233,31 +236,27 @@ function toConventionalChangelog( ast, options ) {
233236
}
234237
break;
235238
case 'text':
236-
if ( node.value.indexOf( options.issueURL ) !== 1 ) {
239+
if ( contains( node.value, options.issueURL ) ) {
237240
reference.url = node.value;
238241
reference.ref = node.value.split( '/' ).pop();
239-
} else if ( node.value.indexOf( options.prURL ) !== 1 ) {
242+
}
243+
else if ( contains( node.value, options.prURL ) ) {
240244
hasPRURL = true;
241245
reference.url = node.value;
242246
reference.ref = node.value.split('/').pop();
243-
} else if ( node.value.charAt( 0 ) === '#' ) {
244-
hasRefSeparator = true;
245-
reference.ref = node.value.substring( 1 );
246-
if ( !reference.url ) {
247-
if ( closesIssue ) {
248-
reference.url = options.issueURL + reference.ref;
249-
} else if ( hasPRURL ) {
250-
reference.url = options.prURL + reference.ref;
251-
}
247+
}
248+
if ( !reference.url ) {
249+
// Case: reference is not an issue or PR URL
250+
if ( RE_LEADING_HASH.test( node.value ) ) {
251+
hasRefSeparator = true;
252+
reference.ref = replace( node.value, RE_LEADING_HASH, '' );
253+
} else {
254+
reference.ref = node.value;
252255
}
253-
} else {
254-
reference.ref = node.value;
255-
if ( !reference.url ) {
256-
if ( closesIssue ) {
257-
reference.url = options.issueURL + reference.ref;
258-
} else if ( hasPRURL ) {
259-
reference.url = options.prURL + reference.ref;
260-
}
256+
if ( closesIssue ) {
257+
reference.url = options.issueURL + reference.ref;
258+
} else if ( hasPRURL ) {
259+
reference.url = options.prURL + reference.ref;
261260
}
262261
}
263262
break;

lib/node_modules/@stdlib/_tools/scripts/templates/workflow_publish.yml.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ jobs:
206206
# Publish package to npm:
207207
- name: 'Publish package to npm'
208208
# Pin action to full length commit SHA
209-
uses: JS-DevTools/npm-publish@4b07b26a2f6e0a51846e1870223e545bae91c552 # v3.0.1
209+
uses: JS-DevTools/npm-publish@19c28f1ef146469e409470805ea4279d47c3d35c # v3.1.1
210210
with:
211211
token: ${{ secrets.NPM_TOKEN }}
212212
access: public

lib/node_modules/@stdlib/_tools/scripts/templates/workflow_publish_cli.yml.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ jobs:
129129
# Publish package to npm:
130130
- name: 'Publish package to npm'
131131
# Pin action to full length commit SHA
132-
uses: JS-DevTools/npm-publish@4b07b26a2f6e0a51846e1870223e545bae91c552 # v3.0.1
132+
uses: JS-DevTools/npm-publish@19c28f1ef146469e409470805ea4279d47c3d35c # v3.1.1
133133
with:
134134
token: ${{ secrets.NPM_TOKEN }}
135135
access: public

lib/node_modules/@stdlib/_tools/scripts/templates/workflow_publish_toplevel.yml.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ jobs:
164164
# Publish package to npm:
165165
- name: 'Publish package to npm'
166166
# Pin action to full length commit SHA
167-
uses: JS-DevTools/npm-publish@4b07b26a2f6e0a51846e1870223e545bae91c552 # v3.0.1
167+
uses: JS-DevTools/npm-publish@19c28f1ef146469e409470805ea4279d47c3d35c # v3.1.1
168168
with:
169169
token: ${{ secrets.NPM_TOKEN }}
170170
access: public

lib/node_modules/@stdlib/math/base/special/sincos/README.md

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,96 @@ for ( i = 0; i < x.length; i++ ) {
8888

8989
<!-- /.examples -->
9090

91+
<!-- C interface documentation. -->
92+
93+
* * *
94+
95+
<section class="c">
96+
97+
## C APIs
98+
99+
<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->
100+
101+
<section class="intro">
102+
103+
</section>
104+
105+
<!-- /.intro -->
106+
107+
<!-- C usage documentation. -->
108+
109+
<section class="usage">
110+
111+
### Usage
112+
113+
```c
114+
#include "stdlib/math/base/special/sincos.h"
115+
```
116+
117+
#### stdlib_base_sincos( x, &sine, &cosine )
118+
119+
Simultaneously computes the [sine][@stdlib/math/base/special/sin] and [cosine][@stdlib/math/base/special/cos] of a `number` (in radians).
120+
121+
```c
122+
double cosine;
123+
double sine;
124+
125+
stdlib_base_sincos( 4.0, &sine, &cosine );
126+
```
127+
128+
The function accepts the following arguments:
129+
130+
- **x**: `[in] double` input value.
131+
- **sine**: `[out] double*` destination for the sine.
132+
- **cosine**: `[out] double*` destination for the cosine.
133+
134+
```c
135+
void stdlib_base_sincos( const double x, double *sine, double *cosine );
136+
```
137+
138+
</section>
139+
140+
<!-- /.usage -->
141+
142+
<!-- C API usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
143+
144+
<section class="notes">
145+
146+
</section>
147+
148+
<!-- /.notes -->
149+
150+
<!-- C API usage examples. -->
151+
152+
<section class="examples">
153+
154+
### Examples
155+
156+
```c
157+
#include "stdlib/math/base/special/sincos.h"
158+
#include <stdio.h>
159+
160+
int main( void ) {
161+
const double x[] = { 0.0, 1.57, 3.14, 6.28 };
162+
163+
double cosine;
164+
double sine;
165+
int i;
166+
for ( i = 0; i < 4; i++ ) {
167+
stdlib_base_sincos( x[ i ], &sine, &cosine );
168+
printf( "x: %lf => sine: %lf, cosine: %lf\n", x[ i ], sine, cosine );
169+
}
170+
}
171+
```
172+
173+
</section>
174+
175+
<!-- /.examples -->
176+
177+
</section>
178+
179+
<!-- /.c -->
180+
91181
<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->
92182
93183
<section class="related">
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
/**
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2024 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 resolve = require( 'path' ).resolve;
24+
var bench = require( '@stdlib/bench' );
25+
var randu = require( '@stdlib/random/base/randu' );
26+
var isnan = require( '@stdlib/math/base/assert/is-nan' );
27+
var tryRequire = require( '@stdlib/utils/try-require' );
28+
var pkg = require( './../package.json' ).name;
29+
30+
31+
// VARIABLES //
32+
33+
var sincos = tryRequire( resolve( __dirname, './../lib/native.js' ) );
34+
var opts = {
35+
'skip': ( sincos instanceof Error )
36+
};
37+
38+
39+
// MAIN //
40+
41+
bench( pkg+'::native', opts, function benchmark( b ) {
42+
var x;
43+
var y;
44+
var i;
45+
46+
b.tic();
47+
for ( i = 0; i < b.iterations; i++ ) {
48+
x = ( randu() * 20.0 ) - 10.0;
49+
y = sincos( x );
50+
if ( isnan( y[ 0 ] ) || isnan( y[ 1 ] ) ) {
51+
b.fail( 'should not return NaN' );
52+
}
53+
}
54+
b.toc();
55+
if ( isnan( y[ 0 ] ) || isnan( y[ 1 ] ) ) {
56+
b.fail( 'should not return NaN' );
57+
}
58+
b.pass( 'benchmark finished' );
59+
b.end();
60+
});

0 commit comments

Comments
 (0)