Skip to content

Commit 6c6766b

Browse files
committed
Merge branch 'develop' of https://github.com/stdlib-js/stdlib into develop
2 parents 86b31a6 + b283652 commit 6c6766b

File tree

23 files changed

+1408
-7
lines changed

23 files changed

+1408
-7
lines changed

.github/workflows/labeler_needs_changes.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ jobs:
3333
# Define job name:
3434
name: 'Add "Needs Changes" Label when Reviewer Requests Changes'
3535

36-
# Only run this job if the reviewer requested changes:
37-
if: ${{ github.event.review.state == 'changes_requested' }}
36+
# Only run this job if the reviewer requested changes (but do not run on forks due to missing permissions):
37+
if: ${{ github.repository == 'stdlib-js/stdlib' && github.event.review.state == 'changes_requested' }}
3838

3939
# Define job permissions:
4040
permissions:

lib/node_modules/@stdlib/array/base/cartesian-square/README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,14 @@ var out = cartesianSquare( x );
8282

8383
<section class="related">
8484

85+
* * *
86+
87+
## See Also
88+
89+
- <span class="package-name">[`@stdlib/array/cartesian-square`][@stdlib/array/cartesian-square]</span><span class="delimiter">: </span><span class="description">return the Cartesian square.</span>
90+
- <span class="package-name">[`@stdlib/array/base/cartesian-power`][@stdlib/array/base/cartesian-power]</span><span class="delimiter">: </span><span class="description">return the Cartesian power.</span>
91+
- <span class="package-name">[`@stdlib/array/base/cartesian-product`][@stdlib/array/base/cartesian-product]</span><span class="delimiter">: </span><span class="description">return the Cartesian product.</span>
92+
8593
</section>
8694

8795
<!-- /.related -->
@@ -92,6 +100,16 @@ var out = cartesianSquare( x );
92100

93101
[cartesian-product]: https://en.wikipedia.org/wiki/Cartesian_product
94102

103+
<!-- <related-links> -->
104+
105+
[@stdlib/array/cartesian-square]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/cartesian-square
106+
107+
[@stdlib/array/base/cartesian-power]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/cartesian-power
108+
109+
[@stdlib/array/base/cartesian-product]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/cartesian-product
110+
111+
<!-- </related-links> -->
112+
95113
</section>
96114

97115
<!-- /.links -->

lib/node_modules/@stdlib/math/iter/sequences/tribonacci/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,10 +204,10 @@ while ( true ) {
204204

205205
[@stdlib/math/base/special/tribonacci]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/math/base/special/tribonacci
206206

207-
[@stdlib/math/iter/sequences/lucas]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/math/iter/sequences/lucas
208-
209207
[@stdlib/math/base/special/fibonacci]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/math/base/special/fibonacci
210208

209+
[@stdlib/math/iter/sequences/lucas]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/math/iter/sequences/lucas
210+
211211
<!-- </related-links> -->
212212

213213
</section>

lib/node_modules/@stdlib/math/strided/special/bessely0-by/README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,14 @@ console.log( y );
229229

230230
<section class="related">
231231

232+
* * *
233+
234+
## See Also
235+
236+
- <span class="package-name">[`@stdlib/math/strided/special/besselj0-by`][@stdlib/math/strided/special/besselj0-by]</span><span class="delimiter">: </span><span class="description">compute the Bessel function of the first kind of order zero for each element retrieved from an input strided array via a callback function.</span>
237+
- <span class="package-name">[`@stdlib/math/strided/special/besselj1-by`][@stdlib/math/strided/special/besselj1-by]</span><span class="delimiter">: </span><span class="description">compute the Bessel function of the first kind of order one for each element retrieved from an input strided array via a callback function.</span>
238+
- <span class="package-name">[`@stdlib/math/strided/special/bessely1-by`][@stdlib/math/strided/special/bessely1-by]</span><span class="delimiter">: </span><span class="description">compute the Bessel function of the second kind of order one for each element retrieved from an input strided array via a callback function.</span>
239+
232240
</section>
233241

234242
<!-- /.related -->
@@ -243,6 +251,16 @@ console.log( y );
243251

244252
[@stdlib/math/base/special/bessely0]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/math/base/special/bessely0
245253

254+
<!-- <related-links> -->
255+
256+
[@stdlib/math/strided/special/besselj0-by]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/math/strided/special/besselj0-by
257+
258+
[@stdlib/math/strided/special/besselj1-by]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/math/strided/special/besselj1-by
259+
260+
[@stdlib/math/strided/special/bessely1-by]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/math/strided/special/bessely1-by
261+
262+
<!-- </related-links> -->
263+
246264
</section>
247265

248266
<!-- /.links -->

lib/node_modules/@stdlib/stats/base/dists/f/mean/README.md

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,102 @@ for ( i = 0; i < 10; i++ ) {
142142

143143
<!-- /.examples -->
144144

145+
<!-- C interface documentation. -->
146+
147+
* * *
148+
149+
<section class="c">
150+
151+
## C APIs
152+
153+
<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->
154+
155+
<section class="intro">
156+
157+
</section>
158+
159+
<!-- /.intro -->
160+
161+
<!-- C usage documentation. -->
162+
163+
<section class="usage">
164+
165+
### Usage
166+
167+
```c
168+
#include "stdlib/stats/base/dists/f/mean.h"
169+
```
170+
171+
#### stdlib_base_dists_f_mean( d1, d2 )
172+
173+
Evaluates the [expected value][expected-value] of a [F][f-distribution] distribution with parameters `d1` (numerator degrees of freedom) and `d2` (denominator degrees of freedom).
174+
175+
```c
176+
double out = stdlib_base_dists_f_mean( 3.0, 5.0 );
177+
// returns ~1.667
178+
```
179+
180+
The function accepts the following arguments:
181+
182+
- **d1**: `[in] double` numerator degrees of freedom.
183+
- **d2**: `[in] double` denominator degrees of freedom.
184+
185+
```c
186+
double stdlib_base_dists_f_mean( const double d1, const double d2 );
187+
```
188+
189+
</section>
190+
191+
<!-- /.usage -->
192+
193+
<!-- C API usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
194+
195+
<section class="notes">
196+
197+
</section>
198+
199+
<!-- /.notes -->
200+
201+
<!-- C API usage examples. -->
202+
203+
<section class="examples">
204+
205+
### Examples
206+
207+
```c
208+
#include "stdlib/stats/base/dists/f/mean.h"
209+
#include "stdlib/constants/float64/eps.h"
210+
#include <stdlib.h>
211+
#include <stdio.h>
212+
213+
static double random_uniform( const double min, const double max ) {
214+
double v = (double)rand() / ( (double)RAND_MAX + 1.0 );
215+
return min + ( v*(max-min) );
216+
}
217+
218+
int main( void ) {
219+
double d1;
220+
double d2;
221+
double y;
222+
int i;
223+
224+
for ( i = 0; i < 25; i++ ) {
225+
d1 = random_uniform( 0.0, 10.0 ) + STDLIB_CONSTANT_FLOAT64_EPS;
226+
d2 = random_uniform( 0.0, 10.0 ) + STDLIB_CONSTANT_FLOAT64_EPS;
227+
y = stdlib_base_dists_f_mean( d1, d2 );
228+
printf( "d1: %lf, d2: %lf, E(X;d1,d2): %lf\n", d1, d2, y );
229+
}
230+
}
231+
```
232+
233+
</section>
234+
235+
<!-- /.examples -->
236+
237+
</section>
238+
239+
<!-- /.c -->
240+
145241
<!-- 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. -->
146242

147243
<section class="references">

lib/node_modules/@stdlib/stats/base/dists/f/mean/benchmark/benchmark.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
var bench = require( '@stdlib/bench' );
2424
var randu = require( '@stdlib/random/base/randu' );
2525
var isnan = require( '@stdlib/math/base/assert/is-nan' );
26+
var Float64Array = require( '@stdlib/array/float64' );
2627
var EPS = require( '@stdlib/constants/float64/eps' );
2728
var pkg = require( './../package.json' ).name;
2829
var mean = require( './../lib' );
@@ -31,16 +32,23 @@ var mean = require( './../lib' );
3132
// MAIN //
3233

3334
bench( pkg, function benchmark( b ) {
35+
var len;
3436
var d1;
3537
var d2;
3638
var y;
3739
var i;
3840

41+
len = 100;
42+
d1 = new Float64Array( len );
43+
d2 = new Float64Array( len );
44+
for ( i = 0; i < len; i++ ) {
45+
d1[ i ] = ( randu() * 10.0 ) + EPS;
46+
d2[ i ] = ( randu() * 10.0 ) + 2.0 + EPS;
47+
}
48+
3949
b.tic();
4050
for ( i = 0; i < b.iterations; i++ ) {
41-
d1 = ( randu()*10.0 ) + EPS;
42-
d2 = ( randu()*10.0 ) + 2.0 + EPS;
43-
y = mean( d1, d2 );
51+
y = mean( d1[ i % len ], d2[ i % len ] );
4452
if ( isnan( y ) ) {
4553
b.fail( 'should not return NaN' );
4654
}
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
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 EPS = require( '@stdlib/constants/float64/eps' );
26+
var Float64Array = require( '@stdlib/array/float64' );
27+
var randu = require( '@stdlib/random/base/randu' );
28+
var isnan = require( '@stdlib/math/base/assert/is-nan' );
29+
var tryRequire = require( '@stdlib/utils/try-require' );
30+
var pkg = require( './../package.json' ).name;
31+
32+
33+
// VARIABLES //
34+
35+
var mean = tryRequire( resolve( __dirname, './../lib/native.js' ) );
36+
var opts = {
37+
'skip': ( mean instanceof Error )
38+
};
39+
40+
41+
// MAIN //
42+
43+
bench( pkg+'::native', opts, function benchmark( b ) {
44+
var len;
45+
var d1;
46+
var d2;
47+
var y;
48+
var i;
49+
50+
len = 100;
51+
d1 = new Float64Array( len );
52+
d2 = new Float64Array( len );
53+
for ( i = 0; i < len; i++ ) {
54+
d1[ i ] = ( randu() * 10.0 ) + EPS;
55+
d2[ i ] = ( randu() * 10.0 ) + 2.0 + EPS;
56+
}
57+
58+
b.tic();
59+
for ( i = 0; i < b.iterations; i++ ) {
60+
y = mean( d1[ i % len ], d2[ i % len ] );
61+
if ( isnan( y ) ) {
62+
b.fail( 'should not return NaN' );
63+
}
64+
}
65+
b.toc();
66+
if ( isnan( y ) ) {
67+
b.fail( 'should not return NaN' );
68+
}
69+
b.pass( 'benchmark finished' );
70+
b.end();
71+
});

0 commit comments

Comments
 (0)