Skip to content

Commit ec1cdfa

Browse files
Merge branch 'stdlib-js:develop' into levy-quantile
2 parents 2e0c64f + c4bdf1c commit ec1cdfa

File tree

32 files changed

+130
-102
lines changed

32 files changed

+130
-102
lines changed

lib/node_modules/@stdlib/_tools/eslint/rules/new-cap-error/test/fixtures/invalid.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ test = {
8383
'',
8484
'function sqrt( x ) {',
8585
' if ( x < 0 ) {',
86-
' throw TypeError( \'must provide a non-negative number\' );',
86+
' throw TypeError( \'must provide a nonnegative number\' );',
8787
' }',
8888
' return Math.sqrt( x );',
8989
'}'
@@ -99,7 +99,7 @@ test = {
9999
'',
100100
'function sqrt( x ) {',
101101
' if ( x < 0 ) {',
102-
' throw new TypeError( \'must provide a non-negative number\' );',
102+
' throw new TypeError( \'must provide a nonnegative number\' );',
103103
' }',
104104
' return Math.sqrt( x );',
105105
'}'

lib/node_modules/@stdlib/assert/docs/types/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2643,7 +2643,7 @@ interface Namespace {
26432643
*
26442644
* - The function validates that a value is a string. For all other types, the function returns `false`.
26452645
*
2646-
* - A duration string is a string containing a sequence of time units. A time unit is a non-negative integer followed by a unit identifier. The following unit identifiers are supported:
2646+
* - A duration string is a string containing a sequence of time units. A time unit is a nonnegative integer followed by a unit identifier. The following unit identifiers are supported:
26472647
*
26482648
* - `d`: days
26492649
* - `h`: hours

lib/node_modules/@stdlib/assert/is-duration-string/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ bool = isDurationString( '1d2h' );
5252

5353
- The function validates that a `value` is a `string`. For all other types, the function returns `false`.
5454

55-
- A duration string is a string containing a sequence of time units. A time unit is a non-negative integer followed by a unit identifier. The following unit identifiers are supported:
55+
- A duration string is a string containing a sequence of time units. A time unit is a nonnegative integer followed by a unit identifier. The following unit identifiers are supported:
5656

5757
- `d`: days
5858
- `h`: hours

lib/node_modules/@stdlib/assert/is-duration-string/docs/repl.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
function returns `false`.
77

88
A duration string is a string containing a sequence of time units. A time
9-
unit is a non-negative integer followed by a unit identifier. The following
9+
unit is a nonnegative integer followed by a unit identifier. The following
1010
unit identifiers are supported:
1111

1212
- d: days.

lib/node_modules/@stdlib/assert/is-duration-string/docs/types/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
*
2626
* - The function validates that a value is a string. For all other types, the function returns `false`.
2727
*
28-
* - A duration string is a string containing a sequence of time units. A time unit is a non-negative integer followed by a unit identifier. The following unit identifiers are supported:
28+
* - A duration string is a string containing a sequence of time units. A time unit is a nonnegative integer followed by a unit identifier. The following unit identifiers are supported:
2929
*
3030
* - `d`: days
3131
* - `h`: hours

lib/node_modules/@stdlib/assert/is-duration-string/lib/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ var RE_DURATION_STRING = /^(?:\d+d)?(?:\d+h)?(?:\d+m)?(?:\d+s)?(?:\d+ms)?$/i;
3737
*
3838
* - The function validates that a value is a string. For all other types, the function returns `false`.
3939
*
40-
* - A duration string is a string containing a sequence of time units. A time unit is a non-negative integer followed by a unit identifier. The following unit identifiers are supported:
40+
* - A duration string is a string containing a sequence of time units. A time unit is a nonnegative integer followed by a unit identifier. The following unit identifiers are supported:
4141
*
4242
* - `d`: days
4343
* - `h`: hours

lib/node_modules/@stdlib/assert/is-property-key/test/test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,14 @@ tape( 'the function returns `true` if provided a symbol primitive', opts, functi
5454
t.end();
5555
});
5656

57-
tape( 'the function returns `true` if provided a non-negative integer primitive', function test( t ) {
57+
tape( 'the function returns `true` if provided a nonnegative integer primitive', function test( t ) {
5858
t.strictEqual( isPropertyKey( 0 ), true, 'returns true' );
5959
t.strictEqual( isPropertyKey( 1 ), true, 'returns true' );
6060
t.strictEqual( isPropertyKey( 139 ), true, 'returns true' );
6161
t.end();
6262
});
6363

64-
tape( 'the function returns `false` if not provided a string, symbol, or non-negative integer primitive', function test( t ) {
64+
tape( 'the function returns `false` if not provided a string, symbol, or nonnegative integer primitive', function test( t ) {
6565
var values;
6666
var i;
6767

@@ -77,7 +77,7 @@ tape( 'the function returns `false` if not provided a string, symbol, or non-neg
7777
[],
7878
function noop() {},
7979
new String( 'beep' ), // eslint-disable-line no-new-wrappers
80-
new Number( 1 ) // eslint-disable-line no-new-wrappers
80+
new Number( 1 )
8181
];
8282

8383
for ( i = 0; i < values.length; i++ ) {

lib/node_modules/@stdlib/stats/base/dists/chisquare/mgf/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ double out = stdlib_base_dists_chisquare_mgf( 0.4, 2.0 );
189189
The function accepts the following arguments:
190190

191191
- **t**: `[in] double` input value.
192-
- **k**: `[in] double` degrees of freedom (must be non-negative).
192+
- **k**: `[in] double` degrees of freedom (must be nonnegative).
193193

194194
```c
195195
double stdlib_base_dists_chisquare_mgf( const double t, const double k );

lib/node_modules/@stdlib/stats/base/dists/chisquare/mgf/benchmark/c/benchmark.c

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,30 @@
1616
* limitations under the License.
1717
*/
1818

19-
#include <sys/time.h>
2019
#include "stdlib/stats/base/dists/chisquare/mgf.h"
2120
#include <math.h>
2221
#include <stdio.h>
2322
#include <stdlib.h>
2423
#include <time.h>
24+
#include <sys/time.h>
2525

2626
#define NAME "chisquare-mgf"
2727
#define ITERATIONS 1000000
2828
#define REPEATS 3
2929

30+
/**
31+
* Prints the TAP version.
32+
*/
3033
static void print_version( void ) {
3134
printf( "TAP version 13\n" );
3235
}
3336

37+
/**
38+
* Prints the TAP summary.
39+
*
40+
* @param total total number of tests
41+
* @param passing total number of passing tests
42+
*/
3443
static void print_summary( int total, int passing ) {
3544
printf( "#\n" );
3645
printf( "1..%d\n", total ); // TAP plan
@@ -40,6 +49,11 @@ static void print_summary( int total, int passing ) {
4049
printf( "# ok\n" );
4150
}
4251

52+
/**
53+
* Prints benchmarks results.
54+
*
55+
* @param elapsed elapsed time in seconds
56+
*/
4357
static void print_results( double elapsed ) {
4458
double rate = (double)ITERATIONS / elapsed;
4559
printf( " ---\n" );
@@ -49,17 +63,34 @@ static void print_results( double elapsed ) {
4963
printf( " ...\n" );
5064
}
5165

66+
/**
67+
* Returns a clock time.
68+
*
69+
* @return clock time
70+
*/
5271
static double tic( void ) {
5372
struct timeval now;
5473
gettimeofday( &now, NULL );
55-
return (double)now.tv_sec + (double)now.tv_usec / 1.0e6;
74+
return (double)now.tv_sec + (double)now.tv_usec/1.0e6;
5675
}
5776

77+
/**
78+
* Generates a random number on the interval [min,max).
79+
*
80+
* @param min minimum value (inclusive)
81+
* @param max maximum value (exclusive)
82+
* @return random number
83+
*/
5884
static double random_uniform( const double min, const double max ) {
5985
double v = (double)rand() / ( (double)RAND_MAX + 1.0 );
60-
return min + ( v * ( max - min ) );
86+
return min + ( v*(max-min) );
6187
}
6288

89+
/**
90+
* Runs a benchmark.
91+
*
92+
* @return elapsed time in seconds
93+
*/
6394
static double benchmark( void ) {
6495
double elapsed;
6596
double t[ 100 ];
@@ -89,11 +120,14 @@ static double benchmark( void ) {
89120
return elapsed;
90121
}
91122

123+
/**
124+
* Main execution sequence.
125+
*/
92126
int main( void ) {
93127
double elapsed;
94128
int i;
95129

96-
// Use the current time to seed the random number generator:
130+
// Use the current time to seed the random number generator:
97131
srand( time( NULL ) );
98132

99133
print_version();

lib/node_modules/@stdlib/stats/base/dists/chisquare/mgf/include/stdlib/stats/base/dists/chisquare/mgf.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,7 @@ extern "C" {
2727
#endif
2828

2929
/**
30-
* Evaluates the moment-generating function (MGF) for a chi-squared distribution
31-
* with degrees of freedom `k` at a value `t`.
32-
*
33-
* @param t input value
34-
* @param k degrees of freedom (must be non-negative)
35-
* @return evaluated MGF
30+
* Evaluates the moment-generating function (MGF) for a chi-squared distribution with degrees of freedom `k` at a value `t`.
3631
*/
3732
double stdlib_base_dists_chisquare_mgf( const double t, const double k );
3833

0 commit comments

Comments
 (0)