Skip to content

Commit e34299e

Browse files
committed
fix: correct function names, documentation, and code style issues
1 parent 90139ad commit e34299e

8 files changed

Lines changed: 19 additions & 19 deletions

File tree

lib/node_modules/@stdlib/stats/base/dists/weibull/quantile/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,12 +181,12 @@ for ( i = 0; i < 10; i++ ) {
181181
#include "stdlib/stats/base/dists/weibull/quantile.h"
182182
```
183183

184-
#### stdlib_base_weibull_quantile( p, k, lambda )
184+
#### stdlib_base_dists_weibull_quantile( p, k, lambda )
185185

186186
Evaluates the [quantile function][quantile-function] for a [Weibull][weibull-distribution] distribution with [shape parameter][shape] `k` and [scale parameter][scale] `lambda`.
187187

188188
```c
189-
double out = stdlib_base_weibull_quantile( 0.5, 1.0, 1.0 );
189+
double out = stdlib_base_dists_weibull_quantile( 0.5, 1.0, 1.0 );
190190
// returns ~0.693
191191
```
192192

@@ -197,7 +197,7 @@ The function accepts the following arguments:
197197
- **lambda**: `[in] double` scale parameter.
198198

199199
```c
200-
double stdlib_base_weibull_quantile( const double p, const double k, const double lambda );
200+
double stdlib_base_dists_weibull_quantile( const double p, const double k, const double lambda );
201201
```
202202
203203
</section>
@@ -239,7 +239,7 @@ int main( void ) {
239239
p = random_uniform( 0.0, 1.0 );
240240
k = random_uniform( 0.1, 5.0 );
241241
lambda = random_uniform( 0.1, 5.0 );
242-
y = stdlib_base_weibull_quantile( p, k, lambda );
242+
y = stdlib_base_dists_weibull_quantile( p, k, lambda );
243243
printf( "p: %lf, k: %lf, lambda: %lf, Q(p;k,lambda): %lf\n", p, k, lambda, y );
244244
}
245245
}

lib/node_modules/@stdlib/stats/base/dists/weibull/quantile/benchmark/benchmark.native.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
var resolve = require( 'path' ).resolve;
2424
var bench = require( '@stdlib/bench' );
2525
var Float64Array = require( '@stdlib/array/float64' );
26-
var randu = require( '@stdlib/random/base/randu' );
26+
var uniform = require( '@stdlib/random/base/uniform' );
2727
var isnan = require( '@stdlib/math/base/assert/is-nan' );
2828
var tryRequire = require( '@stdlib/utils/try-require' );
2929
var pkg = require( './../package.json' ).name;
@@ -52,9 +52,9 @@ bench( pkg + '::native', opts, function benchmark( b ) {
5252
k = new Float64Array( len );
5353
lambda = new Float64Array( len );
5454
for ( i = 0; i < len; i++ ) {
55-
p[ i ] = randu();
56-
k[ i ] = ( randu() * 4.9 ) + 0.1;
57-
lambda[ i ] = ( randu() * 4.9 ) + 0.1;
55+
p[ i ] = uniform( 0.0, 1.0 );
56+
k[ i ] = uniform( 0.1, 5.0 );
57+
lambda[ i ] = uniform( 0.1, 5.0 );
5858
}
5959

6060
b.tic();

lib/node_modules/@stdlib/stats/base/dists/weibull/quantile/benchmark/c/benchmark.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ static double benchmark( void ) {
108108

109109
t = tic();
110110
for ( i = 0; i < ITERATIONS; i++ ) {
111-
y = stdlib_base_weibull_quantile( p[ i % 100 ], k[ i % 100 ], lambda[ i % 100 ] );
111+
y = stdlib_base_dists_weibull_quantile( p[ i % 100 ], k[ i % 100 ], lambda[ i % 100 ] );
112112
if ( y != y ) {
113113
printf( "should not return NaN\n" );
114114
break;

lib/node_modules/@stdlib/stats/base/dists/weibull/quantile/examples/c/example.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ int main( void ) {
3636
p = random_uniform( 0.0, 1.0 );
3737
k = random_uniform( 0.1, 5.0 );
3838
lambda = random_uniform( 0.1, 5.0 );
39-
y = stdlib_base_weibull_quantile( p, k, lambda );
39+
y = stdlib_base_dists_weibull_quantile( p, k, lambda );
4040
printf( "p: %lf, k: %lf, lambda: %lf, Q(p;k,lambda): %lf\n", p, k, lambda, y );
4141
}
42+
return 0;
4243
}

lib/node_modules/@stdlib/stats/base/dists/weibull/quantile/include/stdlib/stats/base/dists/weibull/quantile.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ extern "C" {
2929
/**
3030
* Evaluates the quantile function for a Weibull distribution with shape parameter `k` and scale parameter `lambda` at a probability `p`.
3131
*/
32-
double stdlib_base_weibull_quantile( const double p, const double k, const double lambda );
32+
double stdlib_base_dists_weibull_quantile( const double p, const double k, const double lambda );
3333

3434
#ifdef __cplusplus
3535
}

lib/node_modules/@stdlib/stats/base/dists/weibull/quantile/lib/main.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ var isnan = require( '@stdlib/math/base/assert/is-nan' );
2828
// MAIN //
2929

3030
/**
31-
* Evaluates the quantile function for a Weibull distribution with scale parameter `k` and shape parameter `lambda` at a probability `p`.
31+
* Evaluates the quantile function for a Weibull distribution with shape parameter `k` and scale parameter `lambda` at a probability `p`.
3232
*
3333
* @param {Probability} p - input value
34-
* @param {PositiveNumber} k - scale parameter
35-
* @param {PositiveNumber} lambda - shape parameter
34+
* @param {PositiveNumber} k - shape parameter
35+
* @param {PositiveNumber} lambda - scale parameter
3636
* @returns {number} evaluated quantile function
3737
*
3838
* @example

lib/node_modules/@stdlib/stats/base/dists/weibull/quantile/src/addon.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,4 @@
1919
#include "stdlib/math/base/napi/ternary.h"
2020
#include "stdlib/stats/base/dists/weibull/quantile.h"
2121

22-
// cppcheck-suppress shadowFunction
23-
STDLIB_MATH_BASE_NAPI_MODULE_DDD_D( stdlib_base_weibull_quantile )
22+
STDLIB_MATH_BASE_NAPI_MODULE_DDD_D( stdlib_base_dists_weibull_quantile )

lib/node_modules/@stdlib/stats/base/dists/weibull/quantile/src/main.c

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

19+
#include "stdlib/stats/base/dists/weibull/quantile.h"
1920
#include "stdlib/math/base/assert/is_nan.h"
2021
#include "stdlib/math/base/special/ln.h"
2122
#include "stdlib/math/base/special/pow.h"
22-
#include "stdlib/stats/base/dists/weibull/quantile.h"
2323

2424
/**
2525
* Evaluates the quantile function for a Weibull distribution with shape parameter `k` and scale parameter `lambda` at a probability `p`.
@@ -30,10 +30,10 @@
3030
* @return evaluated quantile
3131
*
3232
* @example
33-
* double y = stdlib_base_weibull_quantile( 0.5, 1.0, 1.0 );
33+
* double y = stdlib_base_dists_weibull_quantile( 0.5, 1.0, 1.0 );
3434
* // returns ~0.693
3535
*/
36-
double stdlib_base_weibull_quantile( const double p, const double k, const double lambda ) {
36+
double stdlib_base_dists_weibull_quantile( const double p, const double k, const double lambda ) {
3737
if ( stdlib_base_is_nan( k ) || stdlib_base_is_nan( lambda ) || stdlib_base_is_nan( p ) || k <= 0.0 || lambda <= 0.0 || p < 0.0 || p > 1.0 ) {
3838
return 0.0 / 0.0; // NaN
3939
}

0 commit comments

Comments
 (0)