Skip to content

Commit e75e745

Browse files
stdlib-botPlaneshifter
authored andcommitted
chore: update copyright years
1 parent 73a651b commit e75e745

File tree

5 files changed

+12
-24
lines changed

5 files changed

+12
-24
lines changed

lib/node_modules/@stdlib/stats/base/dists/poisson/mgf/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;
@@ -39,7 +39,7 @@ var opts = {
3939

4040
// MAIN //
4141

42-
bench( pkg + '::native', opts, function benchmark( b ) {
42+
bench( pkg+'::native', opts, function benchmark( b ) {
4343
var lambda;
4444
var len;
4545
var t;
@@ -50,8 +50,8 @@ bench( pkg + '::native', opts, function benchmark( b ) {
5050
t = new Float64Array( len );
5151
lambda = new Float64Array( len );
5252
for ( i = 0; i < len; i++ ) {
53-
t[ i ] = ( randu() * 4.0 ) - 2.0;
54-
lambda[ i ] = ( randu() * 9.9 ) + 0.1;
53+
t[ i ] = uniform( -2.0, 2.0 );
54+
lambda[ i ] = uniform( 0.1, 10.0 );
5555
}
5656

5757
b.tic();

lib/node_modules/@stdlib/stats/base/dists/poisson/mgf/manifest.json

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,7 @@
4040
"dependencies": [
4141
"@stdlib/math/base/napi/binary",
4242
"@stdlib/math/base/assert/is-nan",
43-
"@stdlib/math/base/special/exp",
44-
"@stdlib/constants/float64/pinf",
45-
"@stdlib/constants/float64/ninf"
43+
"@stdlib/math/base/special/exp"
4644
]
4745
},
4846
{
@@ -58,9 +56,7 @@
5856
"libpath": [],
5957
"dependencies": [
6058
"@stdlib/math/base/assert/is-nan",
61-
"@stdlib/math/base/special/exp",
62-
"@stdlib/constants/float64/pinf",
63-
"@stdlib/constants/float64/ninf"
59+
"@stdlib/math/base/special/exp"
6460
]
6561
},
6662
{
@@ -76,9 +72,7 @@
7672
"libpath": [],
7773
"dependencies": [
7874
"@stdlib/math/base/assert/is-nan",
79-
"@stdlib/math/base/special/exp",
80-
"@stdlib/constants/float64/pinf",
81-
"@stdlib/constants/float64/ninf"
75+
"@stdlib/math/base/special/exp"
8276
]
8377
}
8478
]

lib/node_modules/@stdlib/stats/base/dists/poisson/mgf/src/addon.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616
* limitations under the License.
1717
*/
1818

19-
#include "stdlib/math/base/napi/binary.h"
2019
#include "stdlib/stats/base/dists/poisson/mgf.h"
20+
#include "stdlib/math/base/napi/binary.h"
2121

22-
// cppcheck-suppress shadowFunction
2322
STDLIB_MATH_BASE_NAPI_MODULE_DD_D( stdlib_base_dists_poisson_mgf )

lib/node_modules/@stdlib/stats/base/dists/poisson/mgf/src/main.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@
1616
* limitations under the License.
1717
*/
1818

19+
#include "stdlib/stats/base/dists/poisson/mgf.h"
1920
#include "stdlib/math/base/assert/is_nan.h"
2021
#include "stdlib/math/base/special/exp.h"
2122
#include "stdlib/constants/float64/ninf.h"
2223
#include "stdlib/constants/float64/pinf.h"
23-
#include "stdlib/stats/base/dists/poisson/mgf.h"
2424

2525
/**
2626
* Evaluates the moment-generating function (MGF) for a Poisson distribution with mean parameter `lambda` at a value `t`.
@@ -37,11 +37,5 @@ double stdlib_base_dists_poisson_mgf( const double t, const double lambda ) {
3737
if ( stdlib_base_is_nan( t ) || stdlib_base_is_nan( lambda ) || lambda <= 0.0 ) {
3838
return 0.0 / 0.0; // NaN
3939
}
40-
if ( t == STDLIB_CONSTANT_FLOAT64_NINF ) {
41-
return 0.0;
42-
}
43-
if ( t == STDLIB_CONSTANT_FLOAT64_PINF ) {
44-
return STDLIB_CONSTANT_FLOAT64_PINF;
45-
}
4640
return stdlib_base_exp( lambda * ( stdlib_base_exp( t ) - 1.0 ) );
4741
}

lib/node_modules/@stdlib/stats/base/dists/poisson/mgf/test/test.native.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ var tape = require( 'tape' );
2525
var tryRequire = require( '@stdlib/utils/try-require' );
2626
var isnan = require( '@stdlib/math/base/assert/is-nan' );
2727
var abs = require( '@stdlib/math/base/special/abs' );
28+
var exp = require( '@stdlib/math/base/special/exp' );
2829
var PINF = require( '@stdlib/constants/float64/pinf' );
2930
var NINF = require( '@stdlib/constants/float64/ninf' );
3031
var EPS = require( '@stdlib/constants/float64/eps' );
@@ -79,9 +80,9 @@ tape( 'if provided `+infinity` for `t` and a valid `lambda`, the function return
7980
t.end();
8081
});
8182

82-
tape( 'if provided `-infinity` for `t` and a valid `lambda`, the function returns `0`', opts, function test( t ) {
83+
tape( 'if provided `-infinity` for `t` and a valid `lambda`, the function returns `exp(-lambda)`', opts, function test( t ) {
8384
var y = mgf( NINF, 0.5 );
84-
t.equal( y, 0.0, 'returns 0' );
85+
t.equal( y, exp(-0.5), 'returns exp(-lambda)' );
8586
t.end();
8687
});
8788

0 commit comments

Comments
 (0)