-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ad58cc8
commit 7d45a92
Showing
21 changed files
with
1,396 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,6 +27,7 @@ Daniel Killenberger <[email protected]> | |
Daniel Yu <[email protected]> | ||
Debashis Maharana <[email protected]> | ||
Desh Deepak Kant <[email protected]> | ||
Dev Goel <[email protected]> | ||
Dhruv Arvind Singh <[email protected]> | ||
Divyansh Seth <[email protected]> | ||
Dominic Lim <[email protected]> | ||
|
@@ -50,6 +51,7 @@ Joey Reed <[email protected]> | |
Jordan Gallivan <[email protected]> | ||
Joris Labie <[email protected]> | ||
Justin Dennison <[email protected]> | ||
Karan Anand <[email protected]> | ||
Karthik Prakash <[email protected]> | ||
Kohantika Nath <[email protected]> | ||
Krishnendu Das <[email protected]> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
/** | ||
* @license Apache-2.0 | ||
* | ||
* Copyright (c) 2025 The Stdlib Authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
'use strict'; | ||
|
||
// MODULES // | ||
|
||
var resolve = require( 'path' ).resolve; | ||
var bench = require( '@stdlib/bench-harness' ); | ||
var Float64Array = require( '@stdlib/array-float64' ); | ||
var randu = require( '@stdlib/random-base-randu' ); | ||
var EPS = require( '@stdlib/constants-float64-eps' ); | ||
var isnan = require( '@stdlib/math-base-assert-is-nan' ); | ||
var tryRequire = require( '@stdlib/utils-try-require' ); | ||
var pkg = require( './../package.json' ).name; | ||
|
||
|
||
// VARIABLES // | ||
|
||
var mgf = tryRequire( resolve( __dirname, './../lib/native.js' ) ); | ||
var opts = { | ||
'skip': ( mgf instanceof Error ) | ||
}; | ||
|
||
|
||
// MAIN // | ||
|
||
bench( pkg+'::native', opts, function benchmark( b ) { | ||
var len; | ||
var mu; | ||
var s; | ||
var t; | ||
var y; | ||
var i; | ||
|
||
len = 100; | ||
t = new Float64Array( len ); | ||
mu = new Float64Array( len ); | ||
s = new Float64Array( len ); | ||
for ( i = 0; i < len; i++ ) { | ||
t[ i ] = ( randu()*10.0 ) + EPS; | ||
mu[ i ] = ( randu()*20.0 ) - 10.0; | ||
s[ i ] = ( randu()*5.0 ) + EPS; | ||
} | ||
|
||
b.tic(); | ||
for ( i = 0; i < b.iterations; i++ ) { | ||
y = mgf( t[ i % len ], mu[ i % len ], s[ i % len ] ); | ||
if ( isnan( y ) ) { | ||
b.fail( 'should not return NaN' ); | ||
} | ||
} | ||
b.toc(); | ||
if ( isnan( y ) ) { | ||
b.fail( 'should not return NaN' ); | ||
} | ||
b.pass( 'benchmark finished' ); | ||
b.end(); | ||
}); |
Oops, something went wrong.